Note that there are some explanatory texts on larger screens.

plurals
  1. POCan't find gems in irb: "NameError: uninitialized constant Gem from (irb)"
    primarykey
    data
    text
    <p>When I run a Rails app it finds all of my installed gems correctly.</p> <p>This is the first time I tried to call some gems from inside irb and it couldn't find them.</p> <pre><code>blocke:~$ irb irb(main):001:0&gt; require 'rubygems' =&gt; true irb(main):002:0&gt; require 'rails' LoadError: no such file to load -- rails from /usr/local/lib/site_ruby/1.8/rubygems/custom_require.rb:31:in `gem_original_require' from /usr/local/lib/site_ruby/1.8/rubygems/custom_require.rb:31:in `require' from (irb):2 irb(main):003:0&gt; </code></pre> <p>When I run "gem environment" this is what I get:</p> <pre><code>blocke:~$ gem environment RubyGems Environment: - RUBYGEMS VERSION: 1.3.5 - RUBY VERSION: 1.8.7 (2008-08-11 patchlevel 72) [i486-linux] - INSTALLATION DIRECTORY: /usr/lib/ruby/gems/1.8 - RUBY EXECUTABLE: /usr/bin/ruby1.8 - EXECUTABLE DIRECTORY: /usr/bin - RUBYGEMS PLATFORMS: - ruby - x86-linux - GEM PATHS: - /usr/lib/ruby/gems/1.8 - /home/blocke/.gem/ruby/1.8 - GEM CONFIGURATION: - :update_sources =&gt; true - :verbose =&gt; true - :benchmark =&gt; false - :backtrace =&gt; false - :bulk_threshold =&gt; 1000 - "gem" =&gt; "--no-ri --no-rdoc" - :sources =&gt; ["http://gemcutter.org", "http://gems.rubyforge.org/", "http://gems.github.com"] - REMOTE SOURCES: - http://gemcutter.org - http://gems.rubyforge.org/ - http://gems.github.com </code></pre> <p>According to irb, the gem path is the same except in the reverse order:</p> <pre><code>blocke:~$ irb irb(main):001:0&gt; require 'rubygems' =&gt; true irb(main):002:0&gt; Gem.path =&gt; ["/home/blocke/.gem/ruby/1.8", "/usr/lib/ruby/gems/1.8"] </code></pre>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload