我正在将我的rails应用从Rails 2.3
迁移到3.2
。我有ActiveSupport 3.2依赖,但在应用程序启动时我不断收到以下错误。我没有在我的代码中的任何地方使用active_support / secure_random。有人可以帮我解决这个问题吗?
错误日志 -
[Thu Sep 04 22:52:56.014721 2014] [:warn] [pid 1440] FastCGI: server "AppRootFolder/bin/rails_dispatch.fcgi" (pid 1554) terminated by calling exit with status '1'
AppRootFolder/ruby1.9/gems/1.9.1/gems/activesupport-3.2.19/lib/active_support/dependencies.rb:317:in rescue in depend_on': No such file to load -- active_support/secure_random (LoadError) from AppRootFolder/ruby1.9/gems/1.9.1/gems/activesupport-3.2.19/lib/active_support/dependencies.rb:312:independ_on'
from AppRootFolder/ruby1.9/gems/1.9.1/gems/activesupport-3.2.19/lib/active_support/dependencies.rb:225:in require_dependency' from AppRootFolder/ruby1.9/gems/1.9.1/gems/railties-3.2.19/lib/rails/engine.rb:444:inblock (2 levels) in eager_load!'
from AppRootFolder/ruby1.9/gems/1.9.1/gems/railties-3.2.19/lib/rails/engine.rb:443:in each' from AppRootFolder/ruby1.9/gems/1.9.1/gems/railties-3.2.19/lib/rails/engine.rb:443:inblock in eager_load!'
from AppRootFolder/ruby1.9/gems/1.9.1/gems/railties-3.2.19/lib/rails/engine.rb:441:in each' from AppRootFolder/ruby1.9/gems/1.9.1/gems/railties-3.2.19/lib/rails/engine.rb:441:ineager_load!'
from AppRootFolder/ruby1.9/gems/1.9.1/gems/railties-3.2.19/lib/rails/application/finisher.rb:53:in block in <module:Finisher>' from AppRootFolder/ruby1.9/gems/1.9.1/gems/railties-3.2.19/lib/rails/initializable.rb:30:ininstance_exec'
from AppRootFolder/ruby1.9/gems/1.9.1/gems/railties-3.2.19/lib/rails/initializable.rb:30:in run' from AppRootFolder/ruby1.9/gems/1.9.1/gems/railties-3.2.19/lib/rails/initializable.rb:55:inblock in run_initializers'
from AppRootFolder/ruby1.9/gems/1.9.1/gems/railties-3.2.19/lib/rails/initializable.rb:54:in each' from AppRootFolder/ruby1.9/gems/1.9.1/gems/railties-3.2.19/lib/rails/initializable.rb:54:inrun_initializers'
from AppRootFolder/ruby1.9/gems/1.9.1/gems/railties-3.2.19/lib/rails/application.rb:136:in initialize!' from AppRootFolder/ruby1.9/gems/1.9.1/gems/railties-3.2.19/lib/rails/railtie/configurable.rb:30:inmethod_missing'
from AppRootFolder/var/rails-root/config/environment.rb:4:in <top (required)>' from AppRootFolder/ruby1.9/1.9.1/rubygems/custom_require.rb:36:inrequire'
from AppRootFolder/ruby1.9/1.9.1/rubygems/custom_require.rb:36:in require' from AppRootFolder/var/rails-root/config.ru:3:inblock in '
from AppRootFolder/ruby1.9/gems/1.9.1/gems/rack-1.4.5/lib/rack/builder.rb:51:in instance_eval' from AppRootFolder/ruby1.9/gems/1.9.1/gems/rack-1.4.5/lib/rack/builder.rb:51:ininitialize'
from AppRootFolder/var/rails-root/config.ru:in new' from AppRootFolder/var/rails-root/config.ru:in'
from AppRootFolder/ruby1.9/gems/1.9.1/gems/rack-1.4.5/lib/rack/builder.rb:40:in eval' from AppRootFolder/ruby1.9/gems/1.9.1/gems/rack-1.4.5/lib/rack/builder.rb:40:inparse_file'
from AppRootFolder/ruby1.9/gems/1.9.1/gems/rack-1.4.5/lib/rack/server.rb:200:in app' from AppRootFolder/ruby1.9/gems/1.9.1/gems/rack-1.4.5/lib/rack/server.rb:304:inwrapped_app'
from AppRootFolder/ruby1.9/gems/1.9.1/gems/rack-1.4.5/lib/rack/server.rb:254:in start' from AppRootFolder/ruby1.9/gems/1.9.1/gems/rack-1.4.5/lib/rack/server.rb:137:instart'
from AppRootFolder/bin/rails_dispatch.fcgi:20:in `'
答案 0 :(得分:0)
ActiveSupport::SecureRandom
已从rails 3.2中删除,因为rails 3.2需要ruby 1.8.7已经内置了SecureRandom。
用
替换任何要求require 'securerandom'
然后使用SecureRandom
。
如果你没有直接使用SecureRandom,那么你可能正在使用一个gem,例如旧版本的devise。