[Rubygem on shared host] undefined method map for nil:NilClass

David's Avatar

David

22 Mar, 2011 05:50 AM

I can't start my Rails even using a simple ./script/about (see error
output below).

My app is using Rails 2.1.0 on a shared host where rubygems (1.6.1) and
all application's gems are installed in user directory.

It looks like if gem is looking at the wrong place to find its gems.

Config :

[silversurfer:/home/aidscompetence/communitylifecompetence.org/current]$
ls /usr/bin/gem ~/bin/gem
/home/aidscompetence/bin/gem  /usr/bin/gem
[silversurfer:/home/aidscompetence/communitylifecompetence.org/current]$
which gem
/home/aidscompetence/bin/gem
[silversurfer:/home/aidscompetence/communitylifecompetence.org/current]$
gem env
RubyGems Environment:
  - RUBYGEMS VERSION: 1.6.1
  - RUBY VERSION: 1.8.7 (2008-08-11 patchlevel 72) [x86_64-linux]
  - INSTALLATION DIRECTORY: /home/aidscompetence/.gems
  - RUBYGEMS PREFIX: /home/aidscompetence
  - RUBY EXECUTABLE: /usr/bin/ruby1.8
  - EXECUTABLE DIRECTORY: /home/aidscompetence/.gems/bin
  - RUBYGEMS PLATFORMS:
    - ruby
    - x86_64-linux
  - GEM PATHS:
     - /home/aidscompetence/.gems
  - GEM CONFIGURATION:
     - :update_sources => true
     - :verbose => true
     - :benchmark => false
     - :backtrace => false
     - :bulk_threshold => 1000
     - "gempath" => ["/home/aidscompetence/.gems"]
     - "gem" => "--no-ri --no-rdoc"
     - :sources => ["http://gems.github.com",
"http://gems.rubyforge.org"]
     - "gemhome" => "/home/aidscompetence/.gems"
  - REMOTE SOURCES:
     - http://gems.github.com
     - http://gems.rubyforge.org


Error Output:


[silversurfer:/home/aidscompetence/communitylifecompetence.org/current]$
./script/about
./script/../config/../vendor/rails/railties/lib/initializer.rb:225:in
`require_frameworks': no such file to load --
active_support/cache/file_store (RuntimeError)
    from
./script/../config/../vendor/rails/railties/lib/initializer.rb:113:in
`process'
    from
./script/../config/../vendor/rails/railties/lib/initializer.rb:93:in
`send'
    from
./script/../config/../vendor/rails/railties/lib/initializer.rb:93:in
`run'
    from
/home/aidscompetence/communitylifecompetence.org/releases/20100314224301/config/environment.rb:13
    from /home/aidscompetence/lib/rubygems/custom_require.rb:36:in
`gem_original_require'
    from /home/aidscompetence/lib/rubygems/custom_require.rb:36:in
`require'
    from
/home/aidscompetence/communitylifecompetence.org/releases/20100314224301/vendor/rails/railties/lib/commands/about.rb:1
    from /home/aidscompetence/lib/rubygems/custom_require.rb:36:in
`gem_original_require'
    from /home/aidscompetence/lib/rubygems/custom_require.rb:36:in
`require'
    from ./script/about:3


By the way, the file file_store.rb does exists :


[silversurfer:/home/aidscompetence/communitylifecompetence.org/current]$
ls
~/.gems/gems/activesupport-2.1.0/lib/active_support/cache/file_store.rb
/home/aidscompetence/.gems/gems/activesupport-2.1.0/lib/active_support/cache/file_store.rb

-David

  1. Support Staff 2 Posted by Nick Quaranto on 02 Apr, 2011 10:50 PM

    Nick Quaranto's Avatar

    This isn't a rails support forum, and i don't think this a RG problem.

    My suggestion would be to get RVM setup and isolate the gems you have for your app as much as possible. This is why Bundler was made ;)

  2. Nick Quaranto closed this discussion on 02 Apr, 2011 10:50 PM.

  3. David re-opened this discussion on 03 Apr, 2011 12:23 AM

  4. 3 Posted by David on 03 Apr, 2011 12:23 AM

    David's Avatar

    What was happening is that the rails 3 gem was being loaded by rubygems even if the
    was set in the config/environment.rb file, thus the application could not boot.

    It could be a mixed issue between rubygem, rails 2.1, and having gems installed in the user directory.

    But anyway, I am in the process of upgrading the app to rails 3.

  5. Nick Quaranto closed this discussion on 16 Apr, 2011 05:57 PM.

Comments are currently closed for this discussion. You can start a new one.

Keyboard shortcuts

Generic

? Show this help
ESC Blurs the current field

Comment Form

r Focus the comment reply box
^ + ↩ Submit the comment

You can use Command ⌘ instead of Control ^ on Mac