This project is archived and is in readonly mode.

#3990 ✓invalid
Johnny

no such file to load -- bundler (LoadError) in Rails 3.0.0.beta

Reported by Johnny | February 18th, 2010 @ 03:53 PM | in 3.0.2

I installed Rails 3.0.0.beta in both Ruby 1.9.1 and JRuby 1.4.0 following the instructions found here: http://weblog.rubyonrails.org/2010/2/5/rails-3-0-beta-release and after generating a new application with

rails rails3_blog -d mysql

all goes well, but when I try to start the server with

rails server

I get

/home/johnny/workspace/rails3_blog/config/boot.rb:6:in `require': no such file to load -- bundler (LoadError)
from /home/johnny/workspace/rails3_blog/config/boot.rb:6:in `rescue in <top (required)>'
from /home/johnny/workspace/rails3_blog/config/boot.rb:2:in `<top (required)>'
from /home/johnny/workspace/rails3_blog/script/rails:9:in `require'
from /home/johnny/workspace/rails3_blog/script/rails:9:in `<main>'

On JRuby I'm seeing the same error.

My environment is as follows:

$ lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description:    Ubuntu 9.10
Release:        9.10
Codename:       karmic

$ cat /proc/version
Linux version 2.6.31-20-generic (buildd@yellow) (gcc version 4.4.1 (Ubuntu 4.4.1-4ubuntu9) ) [#57](/projects/8994/tickets/57 "Ticket #57")-Ubuntu SMP Mon Feb 8 09:02:26 UTC 2010

$ ruby -v
ruby 1.9.1p243 (2009-07-16 revision 24175) [x86_64-linux]

$ jruby -v
jruby 1.4.0 (ruby 1.8.7 patchlevel 174) (2009-11-02 69fbfa3) (Java HotSpot(TM) 64-Bit Server VM 1.6.0_15) [amd64-java]

Comments and changes to this ticket

  • Marc Love

    Marc Love February 18th, 2010 @ 11:00 PM

    It could be that you have an old version of the bundler gem still installed on your system and it causes issues with the updated version operating correctly. Do the following:

    sudo gem uninstall bundler -a
    sudo gem install bundler
    

    Then try it again.

  • Johnny

    Johnny February 19th, 2010 @ 02:35 PM

    @Marc, did as you suggested, but to no avail. I'm still seeing the same error.

  • José Valim

    José Valim February 21st, 2010 @ 12:21 PM

    What gem list -d bundler returns? Something seems to be messed up in your load path. Opening up an irb console and doing 'require "bundler"' works?

  • Johnny

    Johnny February 22nd, 2010 @ 02:35 PM

    @Valim,

    Here it is:

    $ gem list -d bundler
    
    *** LOCAL GEMS ***
    
    bundler (0.9.7)
        Authors: Carl Lerche, Yehuda Katz
        Homepage: http://github.com/carlhuda/bundler
        Installed at: /usr/lib/ruby1.9.1/gems/1.9.1
    
        Bundles are fun
    
    $ irb
    irb(main):001:0> require "bundler"
    LoadError: no such file to load -- bundler
            from (irb):1:in `require'
        from (irb):1
            from /usr/local/bin/irb:12:in `<main>'
    
  • José Valim

    José Valim February 23rd, 2010 @ 09:13 PM

    • State changed from “new” to “invalid”

    It cannot find bundler for some odd reason. Try reinstalling bundler, rails or a clean setup with RVM.
    I'm marking as invalid, feel free to open another ticket if I'm wrong.

  • Johnny

    Johnny March 3rd, 2010 @ 05:32 PM

    If I enter a shell with the command:

    bundle exec batch
    

    then the error disappears and the server starts up.

  • Eric Koslow

    Eric Koslow March 4th, 2010 @ 05:54 AM

    I have this same error, and Ubuntu 9.10. I think it has to do with my PATH, but I'm not certain. I can run bundle from the command line, but "require 'bundler'" gives me the same error.

  • Greg Moreno

    Greg Moreno March 8th, 2010 @ 02:44 AM

    I encountered the same problem with ruby 1.9.1p243 + ubuntu 9.10. Setting GEM_HOME fixes the problem.

  • Jeremy Kemper

    Jeremy Kemper April 27th, 2010 @ 07:26 PM

    • Milestone cleared.
    • State changed from “invalid” to “open”
    • Assigned user set to “Yehuda Katz (wycats)”
  • neocoin

    neocoin May 2nd, 2010 @ 02:13 AM

    I encountered the same problem

    environment

    ubuntu 10.04
    ruby1.9.1p378
    

    executed commands:

    gem1.9.1 install --no-ri --no-rdoc rails --pre
    rails my
    cd my
    rails s
    
    /...ignore.../my/config/boot.rb:4:in `require': no such file to load -- bundler (LoadError)
        from /...ignore.../my/config/boot.rb:4:in `<top (required)>'
        from script/rails:8:in `require'
        from script/rails:8:in `<main>'
    
  • Arnaud Leymet

    Arnaud Leymet May 6th, 2010 @ 04:46 PM

    I got the same error on Ubuntu 10.04 desktop i386, while using Ruby1.9.1 with Rails 3-pre.
    And As Greg said, changing the GEM_HOME environment variable does the trick!
    I used the following command to fix this issue:

    export GEM_HOME=/usr/lib/ruby1.9.1/gems/1.9.1/
    
  • avapoet

    avapoet May 17th, 2010 @ 12:26 PM

    @Arnaud:

    Same problem on Ubuntu 10.04 desktop i386, but I needed to run:

    export GEM_HOME=/usr/lib/ruby/gems/1.9.1/

    Pay attention and check what's right for you. The correct directory is the one which contains the gems directory which in turn contains all of your gems!

  • Rohit Arondekar

    Rohit Arondekar May 23rd, 2010 @ 06:49 AM

    I can't reproduce this on Ubuntu 10.04, seems to be a path problem. If you encounter this error do what avapoet has suggested and figure out where your gems are and set GEM_HOME to that path. I believe this ticket can be closed?

  • Ryan Bigg

    Ryan Bigg May 23rd, 2010 @ 06:53 AM

    • State changed from “open” to “invalid”

    Must set the GEM_HOME environment variable. I think this is more of a bundler issue than a Rails issue (although it does occur during the use of Rails, it may occur elsewhere too)

  • Ryan Bigg

    Ryan Bigg May 23rd, 2010 @ 06:56 AM

    • Tag cleared.

    And Rohit informs me it's a package manager issue, not a Bundler issue.

    If OP could provide detailed information on how he installed Ruby / Rails then we may be able to go about reproducing this and nail down the real culprit.

  • Will St. Clair

    Will St. Clair June 4th, 2010 @ 09:24 PM

    Upgrading an app to R3 and having this problem. Reinstalled bundler and set GEM_HOME to no avail. Mac OS X 10.6, ruby 1.8.7

    $ rails server
    script/rails:9:in `require': no such file to load -- rails/commands (LoadError)
        from script/rails:9
    
    $ irb
    >> require "bundler"
    => true
    >> quit
    
    $ echo $GEM_HOME
    /usr/lib/ruby/gems/1.8/gems/
    

    I tried bundle exec batch but it just hung so I killed it. Sigh.

  • Will St. Clair

    Will St. Clair June 4th, 2010 @ 09:46 PM

    Disregard! sudo bundle install was bundling 2.3.8 instead of 3.0.0.beta3. Fixed it by specifying the version in my Gemfile.

  • Jeremy Kemper

    Jeremy Kemper October 15th, 2010 @ 11:01 PM

    • Milestone set to 3.0.2
  • Alex Pooley

    Alex Pooley December 18th, 2010 @ 06:40 AM

    fwiw... I had to set "RUBYOPT=rubygems" env variable to make bundler happy...

    uubuntu@ip-10-170-77-113:~$ bundle
    /var/lib/gems/1.8/gems/bundler-1.0.7/bin/bundle:4:in `require': no such file to load -- bundler (LoadError)
        from /var/lib/gems/1.8/gems/bundler-1.0.7/bin/bundle:4
    ubuntu@ip-10-170-77-113:~$ export RUBYOPT=rubygems
    ubuntu@ip-10-170-77-113:~$ bundle
    Could not locate Gemfile
    
  • herval

    herval February 10th, 2011 @ 08:04 PM

    this might be a completely unrelated case, but... I've stumbled on this problem lately when running a rails app in my env (Snow Leopard + RVM + 1.9.2). I get the 'bundler not found' problem when starting with sudo (to use port 80), but NOT when running regularly

    $ script/rails server => Booting WEBrick => Rails 3.0.1 application starting in development on http://0.0.0.0:3000 => Call with -d to detach => Ctrl-C to shutdown server [2011-02-10 16:59:17] INFO WEBrick 1.3.1 [2011-02-10 16:59:17] INFO ruby 1.9.2 (2010-12-25) [x86_64-darwin10.6.0] [2011-02-10 16:59:17] INFO WEBrick::HTTPServer#start: pid=82986 port=3000

    versus....

    $ sudo script/rails server /Users/herval/Development/plim/config/boot.rb:9:in rescue in <top (required)>': uninitialized constant Object::Bundler (NameError)

    from /Users/herval/Development/plim/config/boot.rb:5:in `<top (required)>'
    from <internal:lib/rubygems/custom_require>:29:in `require'
    from <internal:lib/rubygems/custom_require>:29:in `require'
    from script/rails:5:in `<main>'
    

    Guess it's more of a problem related to RVM and some weird linkage to osx's system ruby? (I installed RVM on a user level)

Create your profile

Help contribute to this project by taking a few moments to create your personal profile. Create your profile »

<h2 style="font-size: 14px">Tickets have moved to Github</h2>

The new ticket tracker is available at <a href="https://github.com/rails/rails/issues">https://github.com/rails/rails/issues</a>

Pages