Migration problem w / sqlite3, get error message-> undefined prerequisites method for nil: NilClass

I am working on a RoR3 tutorial and I am in chapter 6 when I tried the rakedb: migrate command . I got a message:

rake is interrupted! undefined prerequisite method for nil: NilClass

I ignored the changes to the Gemfile as it already installed sqlite3. When I changed it to 'sqlite3-ruby', '1.2.5': required => 'sqlite3' , I received the message ActiveRecord :: ConnectionNotEstablished when I tried to view the page locally. So, I just decided not to make this change.

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

+5
source share
1 answer

I am currently working on the same tutorial and faced the same problem. After some digging, it turns out that this is an error with rspec-rails. If you look at the rpsec-rails change log for 2.6.1

protect against calling preconditions in the task nal default rake (Jack Dempsey)

the book also does not have the opportunity to tell in detail about what happens when you run "bundle install", it turns out that bundler is designed to solve application dependencies: http://gembundler.com/rationale.html

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

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

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

'rspec " : test to

gem 'rspec', '2.6'

. , !

+17

All Articles