2
these instructionsに続いてRails 3.0.10から3.1.1へのアップグレードが完了し、 rails s
のレールサーバを起動しますが、development
以外の変数RAILS_ENV
を使用するとすぐにエラーが発生しました。"レールCの生産"を実行しているときに、Rails 3.0.10から3.1.1へのアップグレード後に "このようなファイルはインポートされません"
rails c
作品が、rails c production
、rails c test
、または任意のカスタム環境で 結果、 "ロードするようなファイル - importenv(とLoadError)" エラー。ここで
from /gems/activesupport-3.1.1/lib/active_support/dependencies.rb:306:in `rescue in depend_on': No such file to load -- importenv (LoadError)
from /gems/activesupport-3.1.1/lib/active_support/dependencies.rb:301:in `depend_on'
from /gems/activesupport-3.1.1/lib/active_support/dependencies.rb:214:in `require_dependency'
from /gems/railties-3.1.1/lib/rails/engine.rb:417:in `block (2 levels) in eager_load!'
from /gems/railties-3.1.1/lib/rails/engine.rb:416:in `each'
from /gems/railties-3.1.1/lib/rails/engine.rb:416:in `block in eager_load!'
from /gems/railties-3.1.1/lib/rails/engine.rb:414:in `each'
from /gems/railties-3.1.1/lib/rails/engine.rb:414:in `eager_load!'
from /gems/railties-3.1.1/lib/rails/application/finisher.rb:51:in `block in <module:Finisher>'
from /gems/railties-3.1.1/lib/rails/initializable.rb:30:in `instance_exec'
from /gems/railties-3.1.1/lib/rails/initializable.rb:30:in `run'
from /gems/railties-3.1.1/lib/rails/initializable.rb:55:in `block in run_initializers'
from /gems/railties-3.1.1/lib/rails/initializable.rb:54:in `each'
from /gems/railties-3.1.1/lib/rails/initializable.rb:54:in `run_initializers'
from /gems/railties-3.1.1/lib/rails/application.rb:96:in `initialize!'
from /gems/railties-3.1.1/lib/rails/railtie/configurable.rb:30:in `method_missing'
from /config/environment.rb:5:in `<top (required)>'
from /ges/activesupport-3.1.1/lib/active_support/dependencies.rb:240:in `require'
from /gems/activesupport-3.1.1/lib/active_support/dependencies.rb:240:in `block in require'
from /gems/activesupport-3.1.1/lib/active_support/dependencies.rb:223:in `block in load_dependency'
from /gems/activesupport-3.1.1/lib/active_support/dependencies.rb:640:in `new_constants_in'
from /gems/activesupport-3.1.1/lib/active_support/dependencies.rb:223:in `load_dependency'
from /gems/activesupport-3.1.1/lib/active_support/dependencies.rb:240:in `require'
from /gems/railties-3.1.1/lib/rails/application.rb:83:in `require_environment!'
from /gems/railties-3.1.1/lib/rails/commands.rb:39:in `<top (required)>'
from script/rails:6:in `require'
from script/rails:6:in `<main>'
開発環境で 'Rails.application.config.eager_load_paths'を実行すると返されるものは何ですか? 'eager_load! 'は' config.cache_classes'がtrueに設定され、Railsがレーキタスクからロードされていないときにのみ呼び出されるので、 'RAILS_ENV = production rake stats'が狭められているかどうかを調べる価値があります問題を解決する – Garrett