Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Problem migrating w/ sqlite3, receive error message-> undefined method `prerequisites' for nil:NilClass

Tags:

sqlite

rake

I'm working on the RoR3 Tutorial and i'm on chapter 6 when I tried the rakedb:migrate command. I received the message:

rake aborted! undefined method `prerequisites' for nil:NilClass

I ignored the changes to the Gemfile because it already was installing sqlite3. When I changed it to 'sqlite3-ruby', '1.2.5' :required => 'sqlite3', i got an ActiveRecord::ConnectionNotEstablished message when trying to view the page locally. So, I just decided to not make that change.

I am using lion os, ruby 1.9.2p290, rails 3.1.0.rc8. Thx!

like image 838
jebek Avatar asked Sep 13 '11 16:09

jebek


1 Answers

I'm working on the same tutorial at the moment, and ran into the same issue. After some digging, it turns out this is a bug with rspec-rails. If you look at rpsec-rails' change log for 2.6.1

guard against calling prerequisites on nil default rake task (Jack Dempsey)

the book also doesn't get a chance to go into detail on what's going on when you run "bundle install", turns out bundler is meant to solve application dependencies: http://gembundler.com/rationale.html

Anyway, this was the solution: https://github.com/rails/rails/issues/1723

Change 'rspec-rails' under :development in your gemfile to:

gem 'rspec-rails', '2.6.1.beta1'

and 'rspec' under :test to

gem 'rspec', '2.6'

worked for me. Let me know if you want to work through the book together!

like image 62
brendan Avatar answered Nov 01 '22 15:11

brendan