Tags

If you encountered an error that says undefined method write_inheritable_attribute. See below:

C:/Ruby192/lib/ruby/gems/1.9.1/gems/rails-1.1.5/lib/rails_generator/options.rb:33:in `default_options': undefined method `write_inheritable_attribute' for Rails::Generator::Base:Class (NoMethodError)
        from C:/Ruby192/lib/ruby/gems/1.9.1/gems/rails-1.1.5/lib/rails_generator/base.rb:51:in `<class:Base>'
        from C:/Ruby192/lib/ruby/gems/1.9.1/gems/rails-1.1.5/lib/rails_generator/base.rb:46:in `<module:Generator>'
        from C:/Ruby192/lib/ruby/gems/1.9.1/gems/rails-1.1.5/lib/rails_generator/base.rb:18:in `<module:Rails>'
        from C:/Ruby192/lib/ruby/gems/1.9.1/gems/rails-1.1.5/lib/rails_generator/base.rb:17:in `<top (required)>'
        from C:/Ruby192/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:53:in `require'
        from C:/Ruby192/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:53:in `require'
        from C:/Ruby192/lib/ruby/gems/1.9.1/gems/rails-1.1.5/lib/rails_generator.rb:34:in `<top (required)>'
        from C:/Ruby192/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:53:in `require'
        from C:/Ruby192/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:53:in `require'
        from C:/Ruby192/lib/ruby/gems/1.9.1/gems/rails-1.1.5/bin/rails:13:in `<top (required)>'
        from C:/Ruby192/bin/rails:19:in `load'
        from C:/Ruby192/bin/rails:19:in `<main>'

Solution:
Simply upgrade your rails version! Check first the version of your Ruby as well as the Rails. Mine is 3.2.11 but the current stable is 3.2.12.

C:/Ruby192/>ruby -v
ruby 1.9.2p290 (2011-07-09) [i386-mingw32]
C:/Ruby192/>rails -v
Rails 3.2.11
C:/Ruby192/>gem install rails
...
...
Fetching: rails-3.2.12.gem (100%)
Successfully installed rails-3.2.12
C:/Ruby192/>
Advertisements