开发者

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

开发者 https://www.devze.com 2023-04-04 09:24 出处:网络
I\'m working on the RoR3 Tutorial and i\'mon chapter 6 when I tried the rakedb:migrate command.I received the message:

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. Wh开发者_StackOverflow中文版en 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!


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!

0

精彩评论

暂无评论...
验证码 换一张
取 消