简体   繁体   English

`method_missing&#39;:#的未定义方法`user_class =&#39; <Forem::Engine:0x9de6bc0>

[英]`method_missing': undefined method `user_class=' for #<Forem::Engine:0x9de6bc0>

When i run rails server,i encountered this error. 我在运行Rails Server时遇到此错误。 'bundle install' has been success.My RVM use ruby 1.9.3 and rails 3.2 but the project need rails 3.1.I think the bundle has already solved the because of the bundle.The rails and ruby might not be the reason. ``捆绑安装''已经成功。我的RVM使用ruby 1.9.3和rails 3.2,但项目需要rails 3.1。我认为捆绑包已经解决了这个问题,因为rails和ruby可能不是原因。 Anything would be help.Thanks Your bundle is complete! 一切都会有所帮助。谢谢您的捆绑包已完成! It was installed into ./vendor/bundle 它已安装到./vendor/bundle中

magic@magic-ThinkPad-T430u:~/Documents/rails/ticketee-book$ rails server
=> Booting WEBrick
=> Rails 3.1.0.rc2 application starting in development on http://0.0.0.0:3000
=> Call with -d to detach
=> Ctrl-C to shutdown server
Exiting
/home/magic/Documents/rails/ticketee-book/vendor/bundle/ruby/1.9.1/bundler/gems/rails-623c16f4f8b7/railties/lib/rails/railtie/configurable.rb:30:in `method_missing': undefined method `user_class=' for #<Forem::Engine:0x9de6bc0> (NoMethodError)
    from /home/magic/Documents/rails/ticketee-book/config/initializers/forem.rb:1:in `<top (required)>'
    from /home/magic/Documents/rails/ticketee-book/vendor/bundle/ruby/1.9.1/bundler/gems/rails-623c16f4f8b7/activesupport/lib/active_support/dependencies.rb:235:in `load'
    from /home/magic/Documents/rails/ticketee-book/vendor/bundle/ruby/1.9.1/bundler/gems/rails-623c16f4f8b7/activesupport/lib/active_support/dependencies.rb:235:in `block in load'
    from /home/magic/Documents/rails/ticketee-book/vendor/bundle/ruby/1.9.1/bundler/gems/rails-623c16f4f8b7/activesupport/lib/active_support/dependencies.rb:225:in `block in load_dependency'
    from /home/magic/Documents/rails/ticketee-book/vendor/bundle/ruby/1.9.1/bundler/gems/rails-623c16f4f8b7/activesupport/lib/active_support/dependencies.rb:641:in `new_constants_in'
    from /home/magic/Documents/rails/ticketee-book/vendor/bundle/ruby/1.9.1/bundler/gems/rails-623c16f4f8b7/activesupport/lib/active_support/dependencies.rb:225:in `load_dependency'
    from /home/magic/Documents/rails/ticketee-book/vendor/bundle/ruby/1.9.1/bundler/gems/rails-623c16f4f8b7/activesupport/lib/active_support/dependencies.rb:235:in `load'
    from /home/magic/Documents/rails/ticketee-book/vendor/bundle/ruby/1.9.1/bundler/gems/rails-623c16f4f8b7/railties/lib/rails/engine.rb:544:in `block (2 levels) in <class:Engine>'
    from /home/magic/Documents/rails/ticketee-book/vendor/bundle/ruby/1.9.1/bundler/gems/rails-623c16f4f8b7/railties/lib/rails/engine.rb:543:in `each'
    from /home/magic/Documents/rails/ticketee-book/vendor/bundle/ruby/1.9.1/bundler/gems/rails-623c16f4f8b7/railties/lib/rails/engine.rb:543:in `block in <class:Engine>'
    from /home/magic/Documents/rails/ticketee-book/vendor/bundle/ruby/1.9.1/bundler/gems/rails-623c16f4f8b7/railties/lib/rails/initializable.rb:25:in `instance_exec'
    from /home/magic/Documents/rails/ticketee-book/vendor/bundle/ruby/1.9.1/bundler/gems/rails-623c16f4f8b7/railties/lib/rails/initializable.rb:25:in `run'
    from /home/magic/Documents/rails/ticketee-book/vendor/bundle/ruby/1.9.1/bundler/gems/rails-623c16f4f8b7/railties/lib/rails/initializable.rb:50:in `block in run_initializers'
    from /home/magic/Documents/rails/ticketee-book/vendor/bundle/ruby/1.9.1/bundler/gems/rails-623c16f4f8b7/railties/lib/rails/initializable.rb:49:in `each'
    from /home/magic/Documents/rails/ticketee-book/vendor/bundle/ruby/1.9.1/bundler/gems/rails-623c16f4f8b7/railties/lib/rails/initializable.rb:49:in `run_initializers'
    from /home/magic/Documents/rails/ticketee-book/vendor/bundle/ruby/1.9.1/bundler/gems/rails-623c16f4f8b7/railties/lib/rails/application.rb:96:in `initialize!'
    from /home/magic/Documents/rails/ticketee-book/vendor/bundle/ruby/1.9.1/bundler/gems/rails-623c16f4f8b7/railties/lib/rails/railtie/configurable.rb:30:in `method_missing'
    from /home/magic/Documents/rails/ticketee-book/config/environment.rb:5:in `<top (required)>'
    from /home/magic/Documents/rails/ticketee-book/vendor/bundle/ruby/1.9.1/bundler/gems/rails-623c16f4f8b7/activesupport/lib/active_support/dependencies.rb:239:in `require'
    from /home/magic/Documents/rails/ticketee-book/vendor/bundle/ruby/1.9.1/bundler/gems/rails-623c16f4f8b7/activesupport/lib/active_support/dependencies.rb:239:in `block in require'
    from /home/magic/Documents/rails/ticketee-book/vendor/bundle/ruby/1.9.1/bundler/gems/rails-623c16f4f8b7/activesupport/lib/active_support/dependencies.rb:225:in `block in load_dependency'
    from /home/magic/Documents/rails/ticketee-book/vendor/bundle/ruby/1.9.1/bundler/gems/rails-623c16f4f8b7/activesupport/lib/active_support/dependencies.rb:641:in `new_constants_in'
    from /home/magic/Documents/rails/ticketee-book/vendor/bundle/ruby/1.9.1/bundler/gems/rails-623c16f4f8b7/activesupport/lib/active_support/dependencies.rb:225:in `load_dependency'
    from /home/magic/Documents/rails/ticketee-book/vendor/bundle/ruby/1.9.1/bundler/gems/rails-623c16f4f8b7/activesupport/lib/active_support/dependencies.rb:239:in `require'
    from /home/magic/Documents/rails/ticketee-book/config.ru:4:in `block in <main>'
    from /home/magic/Documents/rails/ticketee-book/vendor/bundle/ruby/1.9.1/gems/rack-1.3.0/lib/rack/builder.rb:51:in `instance_eval'
    from /home/magic/Documents/rails/ticketee-book/vendor/bundle/ruby/1.9.1/gems/rack-1.3.0/lib/rack/builder.rb:51:in `initialize'
    from /home/magic/Documents/rails/ticketee-book/config.ru:1:in `new'
    from /home/magic/Documents/rails/ticketee-book/config.ru:1:in `<main>'
    from /home/magic/Documents/rails/ticketee-book/vendor/bundle/ruby/1.9.1/gems/rack-1.3.0/lib/rack/builder.rb:40:in `eval'
    from /home/magic/Documents/rails/ticketee-book/vendor/bundle/ruby/1.9.1/gems/rack-1.3.0/lib/rack/builder.rb:40:in `parse_file'
    from /home/magic/Documents/rails/ticketee-book/vendor/bundle/ruby/1.9.1/gems/rack-1.3.0/lib/rack/server.rb:200:in `app'
    from /home/magic/Documents/rails/ticketee-book/vendor/bundle/ruby/1.9.1/bundler/gems/rails-623c16f4f8b7/railties/lib/rails/commands/server.rb:46:in `app'
    from /home/magic/Documents/rails/ticketee-book/vendor/bundle/ruby/1.9.1/gems/rack-1.3.0/lib/rack/server.rb:301:in `wrapped_app'
    from /home/magic/Documents/rails/ticketee-book/vendor/bundle/ruby/1.9.1/gems/rack-1.3.0/lib/rack/server.rb:252:in `start'
    from /home/magic/Documents/rails/ticketee-book/vendor/bundle/ruby/1.9.1/bundler/gems/rails-623c16f4f8b7/railties/lib/rails/commands/server.rb:70:in `start'
    from /home/magic/Documents/rails/ticketee-book/vendor/bundle/ruby/1.9.1/bundler/gems/rails-623c16f4f8b7/railties/lib/rails/commands.rb:54:in `block in <top (required)>'
    from /home/magic/Documents/rails/ticketee-book/vendor/bundle/ruby/1.9.1/bundler/gems/rails-623c16f4f8b7/railties/lib/rails/commands.rb:49:in `tap'
    from /home/magic/Documents/rails/ticketee-book/vendor/bundle/ruby/1.9.1/bundler/gems/rails-623c16f4f8b7/railties/lib/rails/commands.rb:49:in `<top (required)>'
    from script/rails:6:in `require'
    from script/rails:6:in `<main>'

Try running server with bundle command. 尝试使用bundle命令运行服务器。 It will use all gems that are defined in your Gemfile then: 然后它将使用您的Gemfile中定义的所有gems:

bundle exec rails server

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 `method_missing&#39;:#的未定义方法&#39;assets&#39; <Rails::Engine::Configuration:0x9d6a6d8> (NoMethodError) - `method_missing': undefined method `assets' for #<Rails::Engine::Configuration:0x9d6a6d8> (NoMethodError) `method_missing&#39;:#的未定义方法`paginates_per&#39; <Class:…> - `method_missing': undefined method `paginates_per' for #<Class:…> Rails 3.0 method_missing:验证器中的未定义方法 - Rails 3.0 method_missing: undefined method in validator Ruby on Rails`method_missing':未定义的方法`active_record' - Ruby on Rails `method_missing': undefined method `active_record' 切换到Rails 4.1时的错误 - `method_missing&#39;:未定义的方法`whitelist_attributes =&#39;表示ActiveRecord :: Base:Class(NoMethodError) - Bug when switching to Rails 4.1 - `method_missing': undefined method `whitelist_attributes=' for ActiveRecord::Base:Class (NoMethodError) 为什么会出现“ method_missing”问题? - Why am I getting `method_missing`? 使用update_attribute并获取NoMethodError:未定义的方法`0 =&#39;表示# - Using update_attribute and getting NoMethodError: undefined method `0=' for #<User:0x007fe470de2950 在多态关联上使用method_missing无效吗? - method_missing doesn't work when used on a polymorphic association? 关系模型university.campus的method_missing - Method_missing for relation model university.campus 类方法的未定义方法 - Undefined method on class method
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM