Ruby Build a Todo List Application with Rails 4 Build a Todo List Application with Rails 4 Set up Git and Add Gems

Nic J Muller
Nic J Muller
9,822 Points

Installing rspec error :(

Hi there, I'm at a loss. Can't seem to solve the issue. I get the following error:

Nicholiss-MacBook-Pro:odot Nicholis$ bin/rails generate rspec:install

/usr/local/var/rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/railties-4.2.5/lib/rails/railtie/configuration.rb:95:in method_missing': undefined methodactive_record' for #<Rails::Application::Configuration:0x007fe65ad66c60> (NoMethodError) from /Users/Nicholis/Projects/odot/config/application.rb:24:in <class:Application>' from /Users/Nicholis/Projects/odot/config/application.rb:10:in<module:Odot>' from /Users/Nicholis/Projects/odot/config/application.rb:9:in <top (required)>' from /usr/local/var/rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/spring-1.6.2/lib/spring/application.rb:82:inrequire' from /usr/local/var/rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/spring-1.6.2/lib/spring/application.rb:82:in preload' from /usr/local/var/rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/spring-1.6.2/lib/spring/application.rb:143:inserve' from /usr/local/var/rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/spring-1.6.2/lib/spring/application.rb:131:in block in run' from /usr/local/var/rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/spring-1.6.2/lib/spring/application.rb:125:inloop' from /usr/local/var/rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/spring-1.6.2/lib/spring/application.rb:125:in run' from /usr/local/var/rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/spring-1.6.2/lib/spring/application/boot.rb:18:in<top (required)>' from /usr/local/var/rbenv/versions/2.3.0/lib/ruby/2.3.0/rubygems/core_ext/kernel_require.rb:55:in require' from /usr/local/var/rbenv/versions/2.3.0/lib/ruby/2.3.0/rubygems/core_ext/kernel_require.rb:55:inrequire' from -e:1:in `<main>'

2 Answers

Andrew Stelmach
Andrew Stelmach
12,377 Points

Hi Nic, you can't use rails generate for installing rspec straight off the bat. Assuming it's a rails project, the best thing you can do is google 'rails rspec' and go to the top result, which should be its github repository. For gems (rspec is a gem), always find their github repo and read the README. Good gems will have good instructions for how to get it up and running.

I'm guessing you haven't added the gem to your Gemfile. Check out those instructions and ignore the bit where it says 'want to run against the master branch?'.

Should solve your problem, let me know if it doesn't. Also, now and in future, always provide a link to your Github repo in your post, if you have one. Cheers.

This same info did not work for me! Even before I saw this post I did the same. please help me!

Nic J Muller
Nic J Muller
9,822 Points

Hi Andrew, thanks for the feedback. All was installed even the gems. I had a prior installation of rbenv so I decided to do a clean install. That sorted everything out.