16

I am running into troubles installing gems through bundle install from an app that i cloned through git.

Here is the what the output from bundle install looks like:

bundle install
/usr/lib/ruby/vendor_ruby/bundler/rubygems_ext.rb:8:in `require': no such file to load --     rubygems (LoadError)
from /usr/lib/ruby/vendor_ruby/bundler/rubygems_ext.rb:8
from /usr/lib/ruby/vendor_ruby/bundler.rb:11:in `require'
from /usr/lib/ruby/vendor_ruby/bundler.rb:11
from /usr/bin/bundle:4:in `require'
from /usr/bin/bundle:4

I read up on google and other stackoverflow questions but the file pointed to above is in th ruby folder so it should not be anyway related to the app (which in theory would mean i wouldn't be able to bundle install for any app). any way how to fix this??

any help will be deeply appreciated!

ShivvyBee
  • 353
  • 1
  • 4
  • 11
  • 1
    refer this http://stackoverflow.com/questions/2896485/no-such-file-to-load-rubygems-loaderror – shrikant1712 May 08 '13 at 09:34
  • I believe this might be my issue, I ran ruby -v and it should have returned ruby 2.0.0-p0 but instead it returned ruby 1.8.7 which is very weird as I never installed it on my linux. – ShivvyBee May 08 '13 at 16:12
  • i think you can uninstall all. Download rails installer from http://railsinstaller.org/ and install it again – shrikant1712 May 09 '13 at 04:18
  • @shrikant1712 Rails installer doesn't have ruby 2.0.0 yet so I think the only way is through rvm or rbenv and I m on ubuntu so I dont think railsinstaller would work, would it? Do you happen to know the command to completely uninstall all versions of ruby in linux? – ShivvyBee May 09 '13 at 05:33
  • 1
    checkout this http://stackoverflow.com/questions/2430059/how-do-i-completely-uninstall-rails-ruby-and-rubygems – shrikant1712 May 09 '13 at 05:39
  • for installing rails with ruby 2.0.0 on linux/ubuntu use this command **wget --no-check-certificate https://raw.github.com/joshfng/railsready/master/railsready.sh && bash railsready.sh** – shrikant1712 May 09 '13 at 05:44

6 Answers6

35

I have the same question with yours, I searched a lot, but no one is the solution, at last, I asked co-worker in my company, he just ran

gem list

to list the local gems, we found there's no bundler gem, so he ran

gem install bundler

then he ran

bundle install

OK, it worked.

Feuda
  • 2,335
  • 30
  • 28
0

Are you in the directory where your gemfile is located? I believe your current directory needs to be there.

Matthew Graves
  • 3,226
  • 1
  • 17
  • 20
0

Once Gemfile.lock is created, whenever you run bundle install, Bundler reads this file rather than Gemfile to work out the dependencies of the application and installs from it.

try check Gemfile/Gemfile.lock what is need to install

hendrathings
  • 3,720
  • 16
  • 30
  • I see. Since I cloned from git I believe I would need to install most of the gems. What I did was I took out the gemfile.lock file from the project directory and put it in a different folder and ran bundle install again. But no luck, still the same error. Shouldn't it create a gemfile.lock if it doesn't see one in the project directory? – ShivvyBee May 08 '13 at 15:53
  • check first list gem install `gem list` and compare with your gemfile. I think the problem your gem not install but you have listed in gemfile. – hendrathings May 19 '13 at 12:01
0

Make sure you're inside your application's directory before you bundle install. Because it will find the GemFile and check what gem needs to install

Lian
  • 1,597
  • 3
  • 17
  • 30
0

Run the following command :

sudo apt-get install rubygems build-essential

It should work like a charm.

-1

I had this same problem (exact same output) and it is solved for me by simply installing the package 'rails'.

sleeves
  • 536
  • 1
  • 5
  • 8