Welcome to the Treehouse Community
Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community!
Looking to learn something new?
Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.Start your free trial
Cannot run "bin/rails generate rspec:install" (LoadError). Kinda lost on how to deal with this
So I was following along with the video on Setting up Git and adding Gems for ODOT but I seem to run into a wall. When trying to run the command "bin/rails generate rspec:install", after adding rspec and capybara to the Gemfile and running bundle, I run into this error:
Alexs-iMac:odot DarkSteel$ bin/rails generate rspec:install /Users/DarkSteel/.rbenv/versions/2.1.2/lib/ruby/2.1.0/rubygems/core_ext/kernel_require.rb:55:in `require': cannot load such file -- bundler/setup (LoadError) from /Users/DarkSteel/.rbenv/versions/2.1.2/lib/ruby/2.1.0/rubygems/core_ext/kernel_require.rb:55:in `require' from /Users/DarkSteel/Desktop/Coding/Treehouse_coding/Treehouse_ruby/ODOT/odot/config/boot.rb:4:in `<top (required)>' from bin/rails:7:in `require_relative' from bin/rails:7:in `<main>'
I'm still new to ruby and this is the first time I have even tried anything with an application or gems, can someone help me out and explain to me why I have run into this error and how to make the command for generating the rspec install to go through? Thanks!
Jeff Jacobson-Swartfager15,419 Points
Alright, I just ran a fresh install using your Gemfile but I'm not getting any errors.
I did notice a couple of differences between your Gemfile and the one that is used in the video though. The video's Gemfile looks like this:
gem 'rails', '4.0.1' gem 'sqlite3' gem 'sass-rails', '~> 4.0.0' gem 'uglifier', '>= 1.3.0' gem 'coffee-rails', '~>4.0.0' gem 'jquery-rails' gem 'turbolinks' gem 'jbuilder', '~> 1.2' group :doc do gem 'sdoc', require: false end group :development, :test do gem 'rspec-rails', '~> 2.0' end group :test do gem 'capybara', '~> 2.1.0' end
Also, I noticed that you are using rbenv. My experience with that is not as extensive as my experience with rvm, but I am aware that it doesn't use the same concept of gemsets. I've found that gemsets are really nice in that they greatly reduce conflicts between multiple versions of the same gem.
gem list to make sure you don't have multiple versions of the same gem.