Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Cannot run `bundle install`

So the other day I ran into an extreme hard disk issue and had to manually delete my .gem folder. I attempted to rebuild the gems for my apps by going into my project folders to run bundle install ... I am unfortunately running into this error:

/home/xxx/.rvm/rubies/ruby-2.2.2/lib/ruby/site_ruby/2.2.0/rubygems/core_ext/kernel_require.rb:54:in `require': cannot load such file -- bundler (LoadError)
    from /home/xxx/.rvm/rubies/ruby-2.2.2/lib/ruby/site_ruby/2.2.0/rubygems/core_ext/kernel_require.rb:54:in `require'
    from /usr/bin/bundle:7:in `<main>'

By the way, line 54 of kernel_require.rb is return gem_original_require(path):

if Gem::Specification.unresolved_deps.empty? then
  RUBYGEMS_ACTIVATION_MONITOR.exit
  return gem_original_require(path)
end
like image 408
Abram Avatar asked May 30 '15 15:05

Abram


People also ask

Is bundle the same as bundle install?

The commands bundle & bundle install also have the same functionality. bundle uses Thor, and bundle 's default task is install . Also, bundle i does the same thing as bundle install because bundle 's task i is mapped (aliased) to install .

What is bundle install without production?

Now, If I use following command: bundle install --without production. In above command, the --without production option prevents the local installation of any production gem means whatever gems are in the production group will not be installed -- which in our example is just one gem: pg .


1 Answers

Since you deleted the ".gem" folder, your Bundler gem is also not present.

Try reinstalling the Bundler gem first by using

gem install bundler

then you can run

bundle install
like image 57
Anant Kolvankar Avatar answered Oct 24 '22 08:10

Anant Kolvankar