Ruby Bundle Install Require: No Such Files to Load Error

ruby bundle install require: no such files to load error

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.

When making a new Rails app, I get the following error: `require': cannot load such file -- bundler (LoadError)

I was running into the same problem today.

I was running ruby 2.2.1 (via rbenv) and rails 4.2.1.

In the end I installed ruby 2.2.2 (via rbenv). I then installed rails 4.2.5. rails new then worked without problem.

So I don't know what the underlying problem is, but maybe this will be helpful to someone.

No such file to load / Missing these required gems

Well, it was just the require that was erroneous

require "google/api_client" 

instead of

require "google-api-client"

Thanks for the help.

cannot load such file -- bundler/setup (LoadError)

It could be that there was a previous Ruby env installed on your system prior to your installation of 2.0? This might have had an existing GEM_PATH that lead to the /1.8 directory which the installation of version 2.0 simply kept.

The problem you where likely having, then, was that Passenger/Apache was looking in the /2.0 directory when in fact the gems were in the /1.8 directory. Your explicitly telling apache to use the /1.8 directory thus makes sense to fix the problem.

SetEnv GEM_HOME /usr/lib/ruby/gems/1.8

You might also try using the Ruby Version Manager to handle multiple Ruby envs.

Some things I found in Google:

  • New to Ruby and am having trouble with LOAD_PATH
  • http://weblog.rubyonrails.org/2009/9/1/gem-packaging-best-practices/
  • http://guides.rubygems.org/faqs/

LoadError: cannot load such file -- bundler/setup

The error shows you are using the system Ruby, not RVM. You need to tell Pow to use the right Ruby version. You need to create a .rvmrc file specifying which Ruby to use, and also create or edit a .powrc or .powenv file to tell Pow to load RVM. See the Pow docs on using RVM.

no such file to load -- rubygems (LoadError)

I have a hunch that you have two ruby versions. Please paste the output of following command:

$ which -a ruby

updated regarding to the comment:

Nuke one version and leave only one. I had same problem with two versions looking at different locations for gems. Had me going crazy for few weeks. Put up a bounty here at SO got me same answer I'm giving to you.

All I did was nuke one installation of ruby and left the one managable via ports. I'd suggest doing this:

  1. Remove ruby version installed via ports (yum or whatever package manager).
  2. Remove ruby version that came with OS (hardcore rm by hand).
  3. Install ruby version from ports with different prefix (/usr instead of /usr/local)
  4. Reinstall rubygems


Related Topics



Leave a reply



Submit