Note that there are some explanatory texts on larger screens.

plurals
  1. PORubygems. A newly installed gem isn't added to $LOAD_PATH ($:)
    primarykey
    data
    text
    <p>I installed the new stable Ruby release and when I began to install gems I found out that the paths to them isn't added to the Ruby load path after successful installation of the gems.</p> <p>What is the reason of this issue? How can I achieve it?</p> <p>Thanks.</p> <p>Here's my environment:</p> <pre> $ lsb_release -d </pre> <pre> Description: Debian GNU/Linux 5.0.6 (lenny) </pre> <pre> $ cat ~/.gemrc </pre> <pre> gem: --no-ri --no-rdoc gemhome: /home/&#60;username&#62;/.gem gempath: - /home/&#60;username&#62;/.gem </pre> <pre> $ gem environment </pre> <pre> RubyGems Environment: - RUBYGEMS VERSION: 1.3.7 - RUBY VERSION: 1.9.2 (2010-08-18 patchlevel 0) [i686-linux] - INSTALLATION DIRECTORY: /home/&#60;username&#62;/.gem - RUBY EXECUTABLE: /usr/local/bin/ruby - EXECUTABLE DIRECTORY: /home/&#60;username&#62;/.gem/bin - RUBYGEMS PLATFORMS: - ruby - x86-linux - GEM PATHS: - /home/&#60;username&#62;/.gem - GEM CONFIGURATION: - :update_sources => true - :verbose => true - :benchmark => false - :backtrace => false - :bulk_threshold => 1000 - "gem" => "--no-ri --no-rdoc" - "gemhome" => "/home/&#60;username&#62;/.gem" - "gempath" => ["/home/&#60;username&#62;/.gem"] - REMOTE SOURCES: - http://rubygems.org/ </pre> <pre> $ gem list </pre> <pre> *** LOCAL GEMS *** rack (1.2.1) sqlite3-ruby (1.3.1) </pre> <pre> $ ruby -e "puts $:" </pre> <pre> # There's neither /home/&#60;username&#62;/.gem/gems/rack-1.2.1/lib # nor home/&#60;username&#62;/.gem/gems/sqlite3-ruby-1.3.1/lib here. /usr/local/lib/ruby/site_ruby/1.9.1 /usr/local/lib/ruby/site_ruby/1.9.1/i686-linux /usr/local/lib/ruby/site_ruby /usr/local/lib/ruby/vendor_ruby/1.9.1 /usr/local/lib/ruby/vendor_ruby/1.9.1/i686-linux /usr/local/lib/ruby/vendor_ruby /usr/local/lib/ruby/1.9.1 /usr/local/lib/ruby/1.9.1/i686-linux </pre> <p><strong>Updated</strong></p> <hr> <p>I can't require any of the installed gems because they arn't in $:.</p> <pre> $ ruby -e "require 'rack'; puts $:" </pre> <pre> :29:in `require': no such file to load -- rack (LoadError) from :29:in `require' from -e:1:in `' </pre> <p>But.</p> <pre> $ ruby -e "$: &#60;&#60; '/home/&#60;username&#62;/.gem/gems/rack-1.2.1/lib'; require 'rack'; puts $:" </pre> <pre> /usr/local/lib/ruby/site_ruby/1.9.1 /usr/local/lib/ruby/site_ruby/1.9.1/i686-linux /usr/local/lib/ruby/site_ruby /usr/local/lib/ruby/vendor_ruby/1.9.1 /usr/local/lib/ruby/vendor_ruby/1.9.1/i686-linux /usr/local/lib/ruby/vendor_ruby /usr/local/lib/ruby/1.9.1 /usr/local/lib/ruby/1.9.1/i686-linux /home/&#60;username&#62;/.gem/gems/rack-1.2.1/lib # Here it is! </pre> <p>It works that way only : (</p>
    singulars
    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