ShivvyBee
ShivvyBee

Reputation: 353

ruby bundle install require: no such files to load error

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!

Upvotes: 16

Views: 21132

Answers (6)

Puneet Arora
Puneet Arora

Reputation: 59

Run the following command :

sudo apt-get install rubygems build-essential

It should work like a charm.

Upvotes: 0

Feuda
Feuda

Reputation: 2365

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.

Upvotes: 35

sleeves
sleeves

Reputation: 536

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

Upvotes: -1

Lian
Lian

Reputation: 1629

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

Upvotes: 0

hendrathings
hendrathings

Reputation: 3765

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

Upvotes: 0

Matthew Graves
Matthew Graves

Reputation: 3284

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

Upvotes: 0

Related Questions