Я использую рельсы версии 3.0.3.
Если я запускаю сервер в среде разработки, все работает нормально, но при попытке запуска в производственной среде рельсы пропускают чтение кода из файла / config / enviroment.rb.
У меня следующая ошибка:
=> Booting WEBrick
=> Rails 3.0.3 application starting in production on http://0.0.0.0:3000
=> Call with -d to detach
=> Ctrl-C to shutdown server
Exiting
/home/herman/WORK/bloomnet/broniszeKwiaty/broniszeKwiaty/broniszeKwiaty/app/models/produkt.rb:10: uninitialized constant Produkt::GRUPY_PRODUKTOWE (NameError)
from /usr/local/lib64/ruby/gems/1.8/gems/railties-3.0.3/lib/rails/engine.rb:138:in `eager_load!'
from /usr/local/lib64/ruby/gems/1.8/gems/railties-3.0.3/lib/rails/engine.rb:137:in `each'
from /usr/local/lib64/ruby/gems/1.8/gems/railties-3.0.3/lib/rails/engine.rb:137:in `eager_load!'
from /usr/local/lib64/ruby/gems/1.8/gems/railties-3.0.3/lib/rails/engine.rb:135:in `each'
from /usr/local/lib64/ruby/gems/1.8/gems/railties-3.0.3/lib/rails/engine.rb:135:in `eager_load!'
from /usr/local/lib64/ruby/gems/1.8/gems/railties-3.0.3/lib/rails/application.rb:108:in `eager_load!'
from /usr/local/lib64/ruby/gems/1.8/gems/railties-3.0.3/lib/rails/application/finisher.rb:41
from /usr/local/lib64/ruby/gems/1.8/gems/railties-3.0.3/lib/rails/initializable.rb:25:in `instance_exec'
from /usr/local/lib64/ruby/gems/1.8/gems/railties-3.0.3/lib/rails/initializable.rb:25:in `run'
from /usr/local/lib64/ruby/gems/1.8/gems/railties-3.0.3/lib/rails/initializable.rb:50:in `run_initializers'
from /usr/local/lib64/ruby/gems/1.8/gems/railties-3.0.3/lib/rails/initializable.rb:49:in `each'
from /usr/local/lib64/ruby/gems/1.8/gems/railties-3.0.3/lib/rails/initializable.rb:49:in `run_initializers'
from /usr/local/lib64/ruby/gems/1.8/gems/railties-3.0.3/lib/rails/application.rb:134:in `initialize!'
from /usr/local/lib64/ruby/gems/1.8/gems/railties-3.0.3/lib/rails/application.rb:77:in `send'
from /usr/local/lib64/ruby/gems/1.8/gems/railties-3.0.3/lib/rails/application.rb:77:in `method_missing'
from /home/herman/WORK/bloomnet/broniszeKwiaty/broniszeKwiaty/broniszeKwiaty/config/environment.rb:5
from /home/herman/WORK/bloomnet/broniszeKwiaty/broniszeKwiaty/broniszeKwiaty/config.ru:3
from /usr/lib64/ruby/gems/1.8/gems/rack-1.2.2/lib/rack/builder.rb:46:in `instance_eval'
from /usr/lib64/ruby/gems/1.8/gems/rack-1.2.2/lib/rack/builder.rb:46:in `initialize'
from /home/herman/WORK/bloomnet/broniszeKwiaty/broniszeKwiaty/broniszeKwiaty/config.ru:1:in `new'
from /home/herman/WORK/bloomnet/broniszeKwiaty/broniszeKwiaty/broniszeKwiaty/config.ru:1
Мой enviroment.rb выглядит так:
# Load the rails application
require File.expand_path('../application', __FILE__)
# Initialize the rails application
BroniszeKwiaty::Application.initialize!
#exceptions
CONTROLLERS_NAMES = {"menu" => "menu_index"}
CONTROLLERS_NAMES_IN_VIEW = {"names" => "imieniny", "produkty" => "towary"}
CONTROLLERS_HIDDEN = [7, 15, 18]
$ZABRONIONE_ROZSZERZENIA = %w{ php rb cgi py shtml pl }
# Ustawienia dla zdjec :
$HEIGHT_MINI3 = 106
$WIDTH_MINI3 = 106
$HEIGHT_CAL = 120
$WIDTH_CAL = 120
$HEIGHT_MINI2 = 163
$WIDTH_MINI2 = 163
$HEIGHT_MINI = 174
$WIDTH_MINI = 174
$WIDTH_MATCHED = 500
$HEIGHT_MATCHED = 300
$WIDTH = 800
$HEIGHT = 600
##################################
$default_cal_path = '/images/cal.png'
$default_cal2_path = '/images/cal2.png'
MENU_URL = { 8 => '/kontakt', 2=> "/informacje", 6=>"/najemcy", 5 =>'/hale', 3 => '/oferta-handlowa', 7 => '/multimedia'} #zastepuje adres /podstrony/:id na wartosc z tablicy (url(/podstrony/2) => url(/informacje))
$ID_HK = 3 #id hali kwiatow w bazie bronisz
$ID_WK = 8 #id wiaty kwiatowej w bazie bronisz
PELNA_NAZWA_HALI = {3 => "hala kwiatowa",8 => "wiata kwiatowa"}
SKROT_NAZWY_HALI = {3 => "HK",8 => "WK"}
GRUPY_PRODUKTOWE = ["opakowania do kwiatów","kwiaty cięte, zieleń","rośliny doniczkowe", "dodatki kwiatowe"]
Большое спасибо за помощь