On Sep 5, 8:48 am, 7stud -- <li...@ruby-forum.com> wrote: > Curiously, you listed the versions of every program except the one that > is throwing the error. > > > I've gone through the exercises in chapter 2 with no problems. > > Not very helpful for people who don't have the book. > > I don't know if this is your problem or not....but in any case you > should never be issuing the command: > > rake db:migrate > > The whole idea behind Bundler and your Gemfile is to specify which gems > you want to use for your app. To use the gems in your Gemfile when > executing commands, you need to proceed the command with 'bundle exec': > > bundle exec rake db:migrate > > That makes sure you are using the rake gem specified in your Gemfile.
That's not the whole story. If just running rake (without the bundle exec) selected a version of rake that was incompatible with what's in the Gemfile/Gemfile.lock then bundler produces an appropriate version message. The problem is the the Gemfile generated by default in a rails app didn't specify a version of rake (possibly because until recently rake hadn't changed much - 0.8.7 was released in May 2009 and 0.9 was released in May 2011), so bundler will pick the most recent version of rake as the one to use. Unfortunately rake 0.9 had some incompatible changes. Newer versions of rails support rake 0.9.x (I think the first such rails version was 3.0.9). You could either switch to the latest 3.0.x version or you need to specify in your Gemfile that you want rake 0.8.7 Fred > > and > > bundle exec rails generate ... > > That makes sure you are using the rails gem in your Gemfile. > > -- > Posted viahttp://www.ruby-forum.com/. -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk@googlegroups.com. To unsubscribe from this group, send email to rubyonrails-talk+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.