This project is archived and is in readonly mode.

#5518 ✓stale
Orlando Agostinho

bundle install: <internal:gem_prelude>:344:in `method_missing': undefined method `user_home' for Gem:Module (NoMethodError)

Reported by Orlando Agostinho | September 1st, 2010 @ 12:42 AM

Hi,

I've just tried to create my first rails app and, after configured the default Gemfile in the first_app directory, the bundle install runs with the following error:
<internal:gem_prelude>:344:in method_missing': undefined methoduser_home' for Gem:Module (NoMethodError)

from /usr/lib/ruby/gems/1.9.1/gems/bundler-1.0.0.rc.6/lib/bundler/settings.rb:109:in `global_config_file'
from /usr/lib/ruby/gems/1.9.1/gems/bundler-1.0.0.rc.6/lib/bundler/settings.rb:6:in `initialize'
from /usr/lib/ruby/gems/1.9.1/gems/bundler-1.0.0.rc.6/lib/bundler.rb:175:in `new'
from /usr/lib/ruby/gems/1.9.1/gems/bundler-1.0.0.rc.6/lib/bundler.rb:175:in `settings'
from /usr/lib/ruby/gems/1.9.1/gems/bundler-1.0.0.rc.6/lib/bundler/cli.rb:213:in `install'
from /usr/lib/ruby/gems/1.9.1/gems/bundler-1.0.0.rc.6/lib/bundler/vendor/thor/task.rb:22:in `run'
from /usr/lib/ruby/gems/1.9.1/gems/bundler-1.0.0.rc.6/lib/bundler/vendor/thor/invocation.rb:118:in `invoke_task'
from /usr/lib/ruby/gems/1.9.1/gems/bundler-1.0.0.rc.6/lib/bundler/vendor/thor.rb:246:in `dispatch'
from /usr/lib/ruby/gems/1.9.1/gems/bundler-1.0.0.rc.6/lib/bundler/vendor/thor/base.rb:389:in `start'
from /usr/lib/ruby/gems/1.9.1/gems/bundler-1.0.0.rc.6/bin/bundle:13:in `<top (required)>'
from /usr/bin/bundle:19:in `load'
from /usr/bin/bundle:19:in `<main>'

opa@debian:~/rails_projects/first_app$

GEMFILE

source 'http://rubygems.org'

gem 'rails', '3.0.0'

Bundle edge Rails instead:

gem 'rails', :git => 'git://github.com/rails/rails.git'

gem 'sqlite3-ruby', '1.2.5', :require => 'sqlite3'

Use unicorn as the web server

gem 'unicorn'

Deploy with Capistrano

gem 'capistrano'

To use debugger

gem 'ruby-debug'

Bundle the extra gems:

gem 'bj'

gem 'nokogiri'

gem 'sqlite3-ruby', :require => 'sqlite3'

gem 'aws-s3', :require => 'aws/s3'

Bundle gems for the local environment. Make sure to

put test-only gems in this group so their generators

and rake tasks are available in development mode:

group :development, :test do

gem 'webrat'

end

"Gemfile" [readonly] 30L, 674C

The information of my system is the following:

       opa@debian:~/rails_projects/first_app$ uname -a
        **Linux debian 2.6.26-2-amd64 [#1](/projects/8994/tickets/1 "Ticket #1") SMP Thu Aug 19 00:37:36 UTC 2010 x86_64 GNU/Linux**
       opa@debian:~/rails_projects/first_app$ gem -v
       **1.3.7**
       opa@debian:~/rails_projects/first_app$ bundle -v
       **Bundler version 1.0.0.rc.6**
       opa@debian:~/rails_projects/first_app$ ruby -v
       **ruby 1.9.1p378 (2010-01-10 revision 26273) [x86_64-linux]**
       opa@debian:~/rails_projects/first_app$

Comments and changes to this ticket

  • David Sommers

    David Sommers October 8th, 2010 @ 07:40 PM

    I have the same issue with Bundler 1.0.2 but it works with an older version.

    It only happens on deployment to Ubuntu - locally it works fine on Mac OS X

    Here's the error:

    [myserver.com] executing command
    

    [out :: myserver.com] <internal:gem_prelude>:344:in method_missing': undefined methoduser_home' for Gem:Module (NoMethodError) [out :: myserver.com] from /usr/lib/ruby/gems/1.9.1/gems/bundler-1.0.2/lib/bundler/settings.rb:109:in global_config_file' ** [out :: myserver.com] from /usr/lib/ruby/gems/1.9.1/gems/bundler-1.0.2/lib/bundler/settings.rb:6:ininitialize' [out :: myserver.com] from /usr/lib/ruby/gems/1.9.1/gems/bundler-1.0.2/lib/bundler.rb:175:in new' ** [out :: myserver.com] from /usr/lib/ruby/gems/1.9.1/gems/bundler-1.0.2/lib/bundler.rb:175:insettings' [out :: myserver.com] from /usr/lib/ruby/gems/1.9.1/gems/bundler-1.0.2/lib/bundler/cli.rb:213:in install' ** [out :: myserver.com] from /usr/lib/ruby/gems/1.9.1/gems/bundler-1.0.2/lib/bundler/vendor/thor/task.rb:22:inrun' [out :: myserver.com] from /usr/lib/ruby/gems/1.9.1/gems/bundler-1.0.2/lib/bundler/vendor/thor/invocation.rb:118:in invoke_task' ** [out :: myserver.com] from /usr/lib/ruby/gems/1.9.1/gems/bundler-1.0.2/lib/bundler/vendor/thor.rb:246:indispatch' [out :: myserver.com] from /usr/lib/ruby/gems/1.9.1/gems/bundler-1.0.2/lib/bundler/vendor/thor/base.rb:389:in start' ** [out :: myserver.com] from /usr/lib/ruby/gems/1.9.1/gems/bundler-1.0.2/bin/bundle:13:in' ** [out :: myserver.com] from /usr/bin/bundle:19:in load' ** [out :: myserver.com] from /usr/bin/bundle:19:in'

    command finished
    

    *** [deploy:update_code] rolling back

    And my Gemfile is short:

    source 'http://rubygems.org'

    group :rake do
    gem 'rake' gem 'capistrano' end

    group :test do
    gem 'rack' end

    group :rake, :test do
    gem 'rspec', '2.0.0.rc'

    if RUBY_PLATFORM =~ /darwin/

    gem 'ruby-debug-base19', '0.11.24'
    gem 'ruby-debug19', '0.11.6'
    

    end end

    And my Rakefile even shorter

    require "rubygems"
    require "bundler"
    Bundler.setup(:default, :rake)
    require "rake"

  • David Trasbo

    David Trasbo October 9th, 2010 @ 12:20 PM

    • Importance changed from “” to “Low”

    This is just a guess, but it might have to do with your RubyGems not being the latest version. Please upgrade and check if the issue goes away, if that is the case.

  • David Trasbo

    David Trasbo October 10th, 2010 @ 04:05 PM

    • State changed from “new” to “invalid”

    Marking this invalid for now. Will reopen if the RubyGems versions turns out to not be the issue.

  • David Sommers

    David Sommers October 10th, 2010 @ 04:51 PM

    RubyGems is 1.3.7

    I'll try to debug it a little more tonight.

  • David Trasbo

    David Trasbo October 10th, 2010 @ 05:55 PM

    • State changed from “invalid” to “open”

    Okay. Reopening this.

  • Ryan Bigg

    Ryan Bigg October 19th, 2010 @ 08:23 AM

    • Tag cleared.

    Automatic cleanup of spam.

  • cosmolee

    cosmolee October 19th, 2010 @ 02:27 PM

    • Tag set to bundler

    Same for me:

    $ bundle install
    <internal:gem_prelude>:344:in `method_missing': undefined method `user_home' for Gem:Module (NoMethodError)
        from /usr/lib/ruby/gems/1.9.1/gems/bundler-1.0.3/lib/bundler/settings.rb:109:in `global_config_file'
        from /usr/lib/ruby/gems/1.9.1/gems/bundler-1.0.3/lib/bundler/settings.rb:6:in `initialize'
        from /usr/lib/ruby/gems/1.9.1/gems/bundler-1.0.3/lib/bundler.rb:175:in `new'
        from /usr/lib/ruby/gems/1.9.1/gems/bundler-1.0.3/lib/bundler.rb:175:in `settings'
        from /usr/lib/ruby/gems/1.9.1/gems/bundler-1.0.3/lib/bundler/cli.rb:217:in `install'
        from /usr/lib/ruby/gems/1.9.1/gems/bundler-1.0.3/lib/bundler/vendor/thor/task.rb:22:in `run'
        from /usr/lib/ruby/gems/1.9.1/gems/bundler-1.0.3/lib/bundler/vendor/thor/invocation.rb:118:in `invoke_task'
        from /usr/lib/ruby/gems/1.9.1/gems/bundler-1.0.3/lib/bundler/vendor/thor.rb:246:i$ cat Gemfile | grep -v ^#
    source 'http://rubygems.org'
    
    gem 'rails', '3.0.1'
    
    
    gem 'sqlite3-ruby', :require => 'sqlite3'
    n `dispatch'
        from /usr/lib/ruby/gems/1.9.1/gems/bundler-1.0.3/lib/bundler/vendor/thor/base.rb:389:in `start'
        from /usr/lib/ruby/gems/1.9.1/gems/bundler-1.0.3/bin/bundle:13:in `<top (required)>'
        from /usr/bin/bundle:19:in `load'
        from /usr/bin/bundle:19:in `<main>'
    
    $ bundle --version
    Bundler version 1.0.3
    
    $ cat Gemfile | grep -v ^#
    source 'http://rubygems.org'
    gem 'rails', '3.0.1'
    gem 'sqlite3-ruby', :require => 'sqlite3'
    
  • cosmolee

    cosmolee October 19th, 2010 @ 02:38 PM

    Oh, and:

    Ubuntu 10.04
    Ruby 1.9.1, which is the latest available via Ubuntu's apt-get repository at this point in time, which, when running rails gets flagged:

    $ rails --version
    
        Rails 3 doesn't officially support Ruby 1.9.1 since recent stable
        releases have segfaulted the test suite. Please upgrade to Ruby 1.9.2
        before Rails 3 is released!
    
        You're running
          ruby 1.9.1p378 (2010-01-10 revision 26273) [i486-linux]
    
    Rails 3.0.1
    
  • David Trasbo

    David Trasbo October 19th, 2010 @ 03:00 PM

    Yeah, it's true that Rails 3 doesn't maintain support for Ruby 1.9.1. Please try upgrading to 1.9.2 and see if the error goes away.

  • cosmolee

    cosmolee October 19th, 2010 @ 08:58 PM

    Installing from ftp.ruby-lang.org seems to have fixed the problem for me. Although there were a few headaches.

    I uninstalled Ruby via the Ubuntu Synaptic package. I also uninstalled Rails with gem uninstall.

    After installing Ruby 1.9.2, I then installed Rails with gem install rails. The install seemed to run fine. But when I tried to run the rails command I got an error:

     /usr/bin/ruby1.9.1: bad interpreter: No such file or directory
    

    I checked and found that /usr/bin/rails has a line specifying ruby1.9.1

    #!/usr/bin/ruby1.9.1
    

    This file was being run instead of /usr/local/bin/rails which says:

    #!/usr/local/bin/ruby
    

    I deleted /usr/bin/rails so that /usr/local/bin/rails ran instead.

  • cosmolee

    cosmolee October 19th, 2010 @ 09:10 PM

    Sorry, that previous post got submitted prematurely.

    Installing from ftp.ruby-lang.org seems to have fixed the problem for me. Although there were a few headaches.

    I uninstalled Ruby 1.9.1 via the Ubuntu Synaptic package. I also uninstalled Rails with gem uninstall.

    After installing Ruby 1.9.2, I then installed Rails with gem install rails. The install seemed to run fine. Oddly, it got installed in gems/1.9.1: /usr/lib/ruby/gems/1.9.1/gems/rails-3.0.1/ (?)

    When I tried to run the rails command I got an error:

     /usr/bin/ruby1.9.1: bad interpreter: No such file or directory
    

    I checked and found that /usr/bin/rails has a line specifying ruby1.9.1

    #!/usr/bin/ruby1.9.1
    

    That file was being run instead of /usr/local/bin/rails which says:

    #!/usr/local/bin/ruby
    

    I deleted /usr/bin/rails so that /usr/local/bin/rails ran instead. You may have to rehash your path or run another terminal to get that new path to run.

    Then the bundle command then ran successfully:

    $ bundle install
    Fetching source index for http://rubygems.org/
    Using rake (0.8.7) 
    Using abstract (1.0.0) 
    Using activesupport (3.0.1) 
    Using builder (2.1.2) 
    Using i18n (0.4.1) 
    Using activemodel (3.0.1) 
    Using erubis (2.6.6) 
    Using rack (1.2.1) 
    Using rack-mount (0.6.13) 
    Using rack-test (0.5.6) 
    Using tzinfo (0.3.23) 
    Using actionpack (3.0.1) 
    Using mime-types (1.16) 
    Using polyglot (0.3.1) 
    Using treetop (1.4.8) 
    Using mail (2.2.7) 
    Using actionmailer (3.0.1) 
    Using arel (1.0.1) 
    Using activerecord (3.0.1) 
    Using activeresource (3.0.1) 
    Using bundler (1.0.3) 
    Using thor (0.14.3) 
    Using railties (3.0.1) 
    Using rails (3.0.1) 
    Installing sqlite3-ruby (1.3.1) with native extensions 
    Your bundle is complete! Use bundle show [gemname] to see where a bundled gem is installed.
    

    HTH.

  • cosmolee

    cosmolee October 19th, 2010 @ 09:18 PM

    BTW, why does the "WATCH" button appear in the second posting of the thread?

    I had a hell of a time finding it, because that doesn't seem like the logical place it should be found....

  • Benjamin Floering

    Benjamin Floering November 10th, 2010 @ 10:43 AM

    This is an issue with bundler, and they are saying that 1.9.1 is not officially supported. You can fix it by suppressing the Gem::QuickLoader.load_full_rubygems_library call in bundler/rubygems_ext.rb with something like.

      Gem::QuickLoader.load_full_rubygems_library unless RUBY_VERSION.eql?('1.9.1')
    

    The bug for this issue lives over on github. I recommend marking this invalid.

  • Santiago Pastorino

    Santiago Pastorino February 11th, 2011 @ 07:18 PM

    This issue has been automatically marked as stale because it has not been commented on for at least three months.

    The resources of the Rails core team are limited, and so we are asking for your help. If you can still reproduce this error on the 3-0-stable branch or on master, please reply with all of the information you have about it and add "[state:open]" to your comment. This will reopen the ticket for review. Likewise, if you feel that this is a very important feature for Rails to include, please reply with your explanation so we can consider it.

    Thank you for all your contributions, and we hope you will understand this step to focus our efforts where they are most helpful.

  • Santiago Pastorino

    Santiago Pastorino February 11th, 2011 @ 07:18 PM

    • State changed from “open” to “stale”
  • Steve Loveless

    Steve Loveless February 18th, 2011 @ 11:43 PM

    I experience this same behavior, although I'm not using rails at all. I'm running ruby 1.9.1-p378 and bundler 1.0.10. Looks like this has nothing to do with rails.

    <internal:gem_prelude>:344:in `method_missing': undefined method `user_home' for Gem:Module (NoMethodError)
        from /usr/local/lib/site_ruby/1.9.1/rubygems.rb:418:in `config_file'
        from /usr/local/lib/site_ruby/1.9.1/rubygems/config_file.rb:243:in `config_file_name'
        from /usr/local/lib/site_ruby/1.9.1/rubygems/config_file.rb:174:in `initialize'
        from /usr/local/lib/site_ruby/1.9.1/rubygems.rb:425:in `new'
        from /usr/local/lib/site_ruby/1.9.1/rubygems.rb:425:in `configuration'
        from /usr/lib/ruby/gems/1.9.1/gems/bundler-1.0.10/lib/bundler/cli.rb:8:in `<top (required)>'
        from /usr/local/lib/site_ruby/1.9.1/rubygems/custom_require.rb:29:in `require'
        from /usr/local/lib/site_ruby/1.9.1/rubygems/custom_require.rb:29:in `require'
        from /usr/lib/ruby/gems/1.9.1/gems/bundler-1.0.10/bin/bundle:10:in `<top (required)>'
        from /usr/bin/bundle:19:in `load'
        from /usr/bin/bundle:19:in `<main>'
    

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>

Tags

Pages