Beginning Ruby Chapter 13, page 399
As I run into problems I am going to post them here and ask for some help. I have the first addition of the book.
I am trying to use ‘migration’ to create my database for the tutorial in this chapter but am running into this error.
C:\Users\David\RubyonRails\InstantRails-2.0-win\rails_apps\mydiary>ruby script/generate migration AddEntriesTable
C:/Ruby/lib/ruby/gems/1.8/gems/rails-2.3.4/lib/initializer.rb:602:in `send’: undefined method `cache_template_extensions=’ for ActionView::Base:Class (NoMethodError)
from C:/Ruby/lib/ruby/gems/1.8/gems/rails-2.3.4/lib/initializer.rb:602:in `initialize_framework_settings’
from C:/Ruby/lib/ruby/gems/1.8/gems/rails-2.3.4/lib/initializer.rb:601:in `each’
from C:/Ruby/lib/ruby/gems/1.8/gems/rails-2.3.4/lib/initializer.rb:601:in `initialize_framework_settings’
from C:/Ruby/lib/ruby/gems/1.8/gems/rails-2.3.4/lib/initializer.rb:598:in `each’
from C:/Ruby/lib/ruby/gems/1.8/gems/rails-2.3.4/lib/initializer.rb:598:in `initialize_framework_settings’
from C:/Ruby/lib/ruby/gems/1.8/gems/rails-2.3.4/lib/initializer.rb:155:in `process’
from C:/Ruby/lib/ruby/gems/1.8/gems/rails-2.3.4/lib/initializer.rb:113:in `send’
from C:/Ruby/lib/ruby/gems/1.8/gems/rails-2.3.4/lib/initializer.rb:113:in `run’
from C:/Users/David/RubyonRails/InstantRails-2.0-win/rails_apps/mydiary/config/environment.rb:13
from C:/Ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `gem_original_require’
from C:/Ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `require’
from C:/Ruby/lib/ruby/gems/1.8/gems/rails-2.3.4/lib/commands/generate.rb:1
from C:/Ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `gem_original_require’
from C:/Ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `require’ from script/generate:3
I have updated all gems via ‘gem update’. Any suggestions?
UPDATE (10 minutes later)
Very quickly both @cglee and @peterc responded with the solution which can be found here.
After commenting out the undefined method. I ran into another error.
C:\Users\David\RubyonRails\InstantRails-2.0-win\rails_apps\mydiary>rake db:migrate
(in C:/Users/David/RubyonRails/InstantRails-2.0-win/rails_apps/mydiary)
!!! The bundled mysql.rb driver has been removed from Rails 2.2. Please install
the mysql gem and try again: gem install mysql.
rake aborted!
126: The specified module could not be found. – C:/Ruby/lib/ruby/gems/1.8/gems
/mysql-2.8.1-x86-mswin32/lib/1.8/mysql_api.so(See full trace by running task with –trace)
But this time I learned my lesson. I quickly searched for the error I ran into and found this solution which worked perfectly.