未初始化的常量ActiveModel :: Observing(NameError)

时间:2016-07-30 12:41:47

标签: ruby-on-rails ruby-on-rails-3 ruby-on-rails-4

我在rails上使用ruby开发了一个Web应用程序。我已经将我的rails版本从3.2升级到4.0,并且在启动我的服务器时出现以下错误。

错误:

  

/home/lakhwani/FCLaunchRequirement/env/FCLaunchRequirementWebsite-1.0/runtime/ruby1.9/gems/1.9.1/gems/dynamoid-0.6.1.1/lib/dynamoid/config.rb:11:in {{1 }}&#39;       来自/home/lakhwani/FCLaunchRequirement/env/FCLaunchRequirementWebsite-1.0/runtime/ruby1.9/gems/1.9.1/gems/dynamoid-0.6.1.1/lib/dynamoid/config.rb:5:in <module:Config>': uninitialized constant ActiveModel::Observing (NameError) from /home/lakhwani/FCLaunchRequirement/env/FCLaunchRequirementWebsite-1.0/runtime/ruby1.9/gems/1.9.1/gems/dynamoid-0.6.1.1/lib/dynamoid/config.rb:8:in需要&#39;       来自/home/lakhwani/FCLaunchRequirement/env/FCLaunchRequirementWebsite-1.0/runtime/ruby1.9/1.9.1/rubygems/custom_require.rb:36:in <top (required)>' from /home/lakhwani/FCLaunchRequirement/env/FCLaunchRequirementWebsite-1.0/runtime/ruby1.9/1.9.1/rubygems/custom_require.rb:36:in&#39;       来自/home/lakhwani/FCLaunchRequirement/env/FCLaunchRequirementWebsite-1.0/runtime/ruby1.9/gems/1.9.1/gems/bundler-1.3.5/lib/bundler/runtime.rb:76:in require' from /home/lakhwani/FCLaunchRequirement/env/FCLaunchRequirementWebsite-1.0/runtime/ruby1.9/gems/1.9.1/gems/dynamoid-0.6.1.1/lib/dynamoid.rb:21:in阻止(2级)需要&#39;       来自/home/lakhwani/FCLaunchRequirement/env/FCLaunchRequirementWebsite-1.0/runtime/ruby1.9/gems/1.9.1/gems/bundler-1.3.5/lib/bundler/runtime.rb:74:in require' from /home/lakhwani/FCLaunchRequirement/env/FCLaunchRequirementWebsite-1.0/runtime/ruby1.9/gems/1.9.1/gems/bundler-1.3.5/lib/bundler/runtime.rb:76:in阻止需要&#39;       来自/home/lakhwani/FCLaunchRequirement/env/FCLaunchRequirementWebsite-1.0/runtime/ruby1.9/gems/1.9.1/gems/bundler-1.3.5/lib/bundler/runtime.rb:63:in each' from /home/lakhwani/FCLaunchRequirement/env/FCLaunchRequirementWebsite-1.0/runtime/ruby1.9/gems/1.9.1/gems/bundler-1.3.5/lib/bundler/runtime.rb:74:in需要&#39;       来自/home/lakhwani/FCLaunchRequirement/env/FCLaunchRequirementWebsite-1.0/runtime/ruby1.9/gems/1.9.1/gems/bundler-1.3.5/lib/bundler.rb:132:in each' from /home/lakhwani/FCLaunchRequirement/env/FCLaunchRequirementWebsite-1.0/runtime/ruby1.9/gems/1.9.1/gems/bundler-1.3.5/lib/bundler/runtime.rb:63:in&# 39;       来自/home/lakhwani/FCLaunchRequirement/env/FCLaunchRequirementWebsite-1.0/runtime/ruby1.9/1.9.1/rubygems/custom_require.rb:36:in require' from /home/lakhwani/FCLaunchRequirement/src/FCLaunchRequirementWebsite/rails-root/config/application.rb:88:in要求&#39;       来自/home/lakhwani/FCLaunchRequirement/src/FCLaunchRequirementWebsite/rails-root/config/environment.rb:6:in require' from /home/lakhwani/FCLaunchRequirement/env/FCLaunchRequirementWebsite-1.0/runtime/ruby1.9/1.9.1/rubygems/custom_require.rb:36:in要求&#39;       来自/home/lakhwani/FCLaunchRequirement/env/FCLaunchRequirementWebsite-1.0/runtime/ruby1.9/1.9.1/rubygems/custom_require.rb:36:in <top (required)>' from /home/lakhwani/FCLaunchRequirement/env/FCLaunchRequirementWebsite-1.0/runtime/ruby1.9/1.9.1/rubygems/custom_require.rb:36:in阻止&#39;       来自/home/lakhwani/FCLaunchRequirement/env/FCLaunchRequirementWebsite-1.0/runtime/ruby1.9/gems/1.9.1/gems/rack-1.5.2/lib/rack/builder.rb:55:in require' from /home/lakhwani/FCLaunchRequirement/src/FCLaunchRequirementWebsite/rails-root/config.ru:3:in初始化&#39;       来自/home/lakhwani/FCLaunchRequirement/src/FCLaunchRequirementWebsite/rails-root/config.ru:in instance_eval' from /home/lakhwani/FCLaunchRequirement/env/FCLaunchRequirementWebsite-1.0/runtime/ruby1.9/gems/1.9.1/gems/rack-1.5.2/lib/rack/builder.rb:55:in&#39;       来自/home/lakhwani/FCLaunchRequirement/env/FCLaunchRequirementWebsite-1.0/runtime/ruby1.9/gems/1.9.1/gems/rack-1.5.2/lib/rack/builder.rb:49:in new' from /home/lakhwani/FCLaunchRequirement/src/FCLaunchRequirementWebsite/rails-root/config.ru:in new_from_string&#39;       来自/home/lakhwani/FCLaunchRequirement/env/FCLaunchRequirementWebsite-1.0/runtime/ruby1.9/gems/1.9.1/gems/rack-1.5.2/lib/rack/builder.rb:40:in eval' from /home/lakhwani/FCLaunchRequirement/env/FCLaunchRequirementWebsite-1.0/runtime/ruby1.9/gems/1.9.1/gems/rack-1.5.2/lib/rack/builder.rb:49:in build_app_and_options_from_config&#39;       来自/home/lakhwani/FCLaunchRequirement/env/FCLaunchRequirementWebsite-1.0/runtime/ruby1.9/gems/1.9.1/gems/rack-1.5.2/lib/rack/server.rb:199:in parse_file' from /home/lakhwani/FCLaunchRequirement/env/FCLaunchRequirementWebsite-1.0/runtime/ruby1.9/gems/1.9.1/gems/rack-1.5.2/lib/rack/server.rb:277:in wrapped_app&#39;       来自/home/lakhwani/FCLaunchRequirement/env/FCLaunchRequirementWebsite-1.0/runtime/ruby1.9/gems/1.9.1/gems/rack-1.5.2/lib/rack/server.rb:250:in app' from /home/lakhwani/FCLaunchRequirement/env/FCLaunchRequirementWebsite-1.0/runtime/ruby1.9/gems/1.9.1/gems/rack-1.5.2/lib/rack/server.rb:314:in启动&#39;       来自/home/lakhwani/FCLaunchRequirement/env/FCLaunchRequirementWebsite-1.0/runtime/ruby1.9/gems/1.9.1/gems/rack-1.5.2/bin/rackup:4:in start' from /home/lakhwani/FCLaunchRequirement/env/FCLaunchRequirementWebsite-1.0/runtime/ruby1.9/gems/1.9.1/gems/rack-1.5.2/lib/rack/server.rb:141:in load&#39;       来自/home/lakhwani/FCLaunchRequirement/env/FCLaunchRequirementWebsite-1.0/runtime/bin/rackup:23:in <top (required)>' from /home/lakhwani/FCLaunchRequirement/env/FCLaunchRequirementWebsite-1.0/runtime/bin/rackup:23:in exec_build_script&#39;:命令退出状态1 !! (RuntimeError)       来自/home/lakhwani/FCLaunchRequirement/env/BrazilRake-1.1/runtime/bin/brazilrake:61:in <main>' /home/lakhwani/FCLaunchRequirement/env/BrazilRake-1.1/runtime/ruby2.1.x/lib/ruby/site_ruby/2.1.0/amazon/brazil/ruby.rb:98:in每个&#39;       来自/home/lakhwani/FCLaunchRequirement/env/BrazilRake-1.1/runtime/bin/brazilrake:48:in`&#39;

任何人都可以帮我解决这个问题吗?

1 个答案:

答案 0 :(得分:0)

您是如何更新rails项目以使用rails 4的?对于rails 4.2及更低版本,如果要更新它,只需在应用程序的Gemfile中添加所需的rails版本并运行rails app:update。关注here