ruby-on-rails-3 – 未定义的方法`write_inheritable_attribute’for Rails :: Generator :: Base:Class(NoMethodError)

前端之家收集整理的这篇文章主要介绍了ruby-on-rails-3 – 未定义的方法`write_inheritable_attribute’for Rails :: Generator :: Base:Class(NoMethodError)前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。
我正在铁路上工作,突然间服务器停止工作.它的工作正常,我使用了以下命令[platform windows 7]
gem install -v=2.3.5 rails

当我使用rails s时,会出现以下错误

c:/Ruby193/lib/ruby/gems/1.9.1/gems/rails-2.3.5/lib/rails_generator/options.rb:32:in `default_options': undefined method `write_inheritable_attribute' for Rails::Generator::Base:Class (NoMethodError)
    from c:/Ruby193/lib/ruby/gems/1.9.1/gems/rails-2.3.5/lib/rails_generator/base.rb:90:in `<class:Base>'
    from c:/Ruby193/lib/ruby/gems/1.9.1/gems/rails-2.3.5/lib/rails_generator/base.rb:85:in `<module:Generator>'
    from c:/Ruby193/lib/ruby/gems/1.9.1/gems/rails-2.3.5/lib/rails_generator/base.rb:48:in `<module:Rails>'
    from c:/Ruby193/lib/ruby/gems/1.9.1/gems/rails-2.3.5/lib/rails_generator/base.rb:6:in `<top (required)>'
    from c:/Ruby193/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:55:in `require'
    from c:/Ruby193/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:55:in `require'
    from c:/Ruby193/lib/ruby/gems/1.9.1/gems/rails-2.3.5/lib/rails_generator.rb:34:in `<top (required)>'
    from c:/Ruby193/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:55:in `require'
    from c:/Ruby193/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:55:in `require'
    from c:/Ruby193/lib/ruby/gems/1.9.1/gems/rails-2.3.5/bin/rails:14:in `<top (required)>'
    from c:/Ruby193/bin/rails:23:in `load'
    from c:/Ruby193/bin/rails:23:in `<main>'

$rails -v
Rails 2.3.5
$ruby -v
ruby 1.9.3p194 (2012-04-20) [i386-mingw32]

解决方法

我也有同样的问题,但是这是宝石rmagick的结果.

我跑了以下:

gem uninstall rmagick 
gem cleanup

然后在堆栈中重新运行捆绑,它再次为我工作.

原文链接:https://www.f2er.com/ruby/273172.html

猜你在找的Ruby相关文章