Note that there are some explanatory texts on larger screens.

plurals
  1. POGem loads in irb but not console
    text
    copied!<p>This one is driving me nuts. I can load a gem via irb:</p> <pre><code>steve@server:/var/www/listings$ irb irb(main):001:0&gt; Gem.path =&gt; ["/home/steve/.gem/ruby/1.9.1", "/usr/local/ruby/lib/ruby/gems/1.9.1"] irb(main):002:0&gt; require 'nokogiri' =&gt; true </code></pre> <p>But I can't load it through the rails console:</p> <pre><code>irb(main):001:0&gt; Gem.path =&gt; ["/home/steve/.gem/ruby/1.9.1", "/usr/local/ruby/lib/ruby/gems/1.9.1"] irb(main):002:0&gt; require 'nokogiri' =&gt; false </code></pre> <p>The gem (nokogiri) is installed </p> <pre><code>steve@server:/var/www/listings$ gem which nokogiri /usr/local/ruby/lib/ruby/gems/1.9.1/gems/nokogiri-1.4.3.1/lib/nokogiri.rb </code></pre> <p>And bundle agrees</p> <pre><code>steve@server:/var/www/listings$ bundle show nokogiri /usr/local/ruby/lib/ruby/gems/1.9.1/gems/nokogiri-1.4.3.1 </code></pre> <p>But, of course, rake spec fails with </p> <pre><code>/usr/local/ruby/lib/ruby/gems/1.9.1/gems/activesupport-3.0.1/lib/active_support/dependencies.rb:304:in `rescue in depend_on': No such file to load -- Nokogiri (LoadError) </code></pre> <p>Other environment info:</p> <pre><code>steve@server:/var/www/listings$ ruby --version ruby 1.9.2p0 (2010-08-18 revision 29036) [i686-linux] steve@server:/var/www/listings$ rails --version Rails 3.0.1 steve@server:/var/www/listings$ gem env RubyGems Environment: - RUBYGEMS VERSION: 1.3.7 - RUBY VERSION: 1.9.2 (2010-08-18 patchlevel 0) [i686-linux] - INSTALLATION DIRECTORY: /usr/local/ruby/lib/ruby/gems/1.9.1 - RUBY EXECUTABLE: /usr/local/ruby/bin/ruby - EXECUTABLE DIRECTORY: /usr/local/ruby/bin - RUBYGEMS PLATFORMS: - ruby - x86-linux - GEM PATHS: - /usr/local/ruby/lib/ruby/gems/1.9.1 - /home/steve/.gem/ruby/1.9.1 - GEM CONFIGURATION: - :update_sources =&gt; true - :verbose =&gt; true - :benchmark =&gt; false - :backtrace =&gt; false - :bulk_threshold =&gt; 1000 - REMOTE SOURCES: - http://rubygems.org/ </code></pre> <p>Any suggestions??</p> <p><strong>Edit</strong></p> <p>By the way, Nokogiri is in the Gemfile and bundle install completes without complaint. </p> <p>This is a project I'm moving from windows to Ubuntu. On windows it's working fine (oddly enough!) so I'm pretty sure it's an environment thing.</p>
 

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