Rubygems local install?

Hi, I’m trying to use a .gem on a machine that I do not have root
permissions on. I’ve been following
http://wiki.rubyonrails.org/rails/pages/HowToUseMultipleGemRepositories
to install gem locally, but no matter what I do I always seem to end up
with: “/gem:9:in `require’: no such file to load – rubygems
(LoadError)”.

Here are the steps I’m taking:

[email protected]:~$ cd /home/mef
[email protected]:~$ mkdir /home/mef/ruby
[email protected]:~$ mkdir /home/mef/ruby/geminstall
[email protected]:~$ mkdir /home/mef/ruby/gems
[email protected]:~$ export GEM_HOME=/home/mef/ruby/gems
[email protected]:~$ cd /home/mef/temp
[email protected]:~/temp$ tar -z -x -f rubygems-0.9.0.tgz
[email protected]:~/temp$ cd rubygems-0.9.0
[email protected]:~/temp/rubygems-0.9.0$ ls
ChangeLog README Rakefile Releases TODO bin doc examples
gemspecs lib pkgs post-install.rb redist scripts setup.rb test
[email protected]:~/temp/rubygems-0.9.0$ ruby setup.rb all
–prefix=/home/mef/ruby/geminstall
—> bin
<— bin
—> lib
—> lib/rbconfig
<— lib/rbconfig
—> lib/rubygems
<— lib/rubygems
<— lib
—> bin
<— bin
—> lib
—> lib/rbconfig
<— lib/rbconfig
—> lib/rubygems
<— lib/rubygems
<— lib
rm -f InstalledFiles
—> bin
mkdir -p /home/mef/ruby/geminstall/bin/
install gem /home/mef/ruby/geminstall/bin/
install gem_mirror /home/mef/ruby/geminstall/bin/
install gem_server /home/mef/ruby/geminstall/bin/
install gemlock /home/mef/ruby/geminstall/bin/
install gemri /home/mef/ruby/geminstall/bin/
install gemwhich /home/mef/ruby/geminstall/bin/
install index_gem_repository.rb /home/mef/ruby/geminstall/bin/
install update_rubygems /home/mef/ruby/geminstall/bin/
<— bin
—> lib
mkdir -p /home/mef/ruby/geminstall/local/lib/site_ruby/1.8/
install gemconfigure.rb
/home/mef/ruby/geminstall/local/lib/site_ruby/1.8/
install rubygems.rb /home/mef/ruby/geminstall/local/lib/site_ruby/1.8/
install ubygems.rb /home/mef/ruby/geminstall/local/lib/site_ruby/1.8/
—> lib/rbconfig
mkdir -p /home/mef/ruby/geminstall/local/lib/site_ruby/1.8/rbconfig
install datadir.rb
/home/mef/ruby/geminstall/local/lib/site_ruby/1.8/rbconfig
<— lib/rbconfig
—> lib/rubygems
mkdir -p /home/mef/ruby/geminstall/local/lib/site_ruby/1.8/rubygems
install builder.rb
/home/mef/ruby/geminstall/local/lib/site_ruby/1.8/rubygems
install cmd_manager.rb
/home/mef/ruby/geminstall/local/lib/site_ruby/1.8/rubygems
install command.rb
/home/mef/ruby/geminstall/local/lib/site_ruby/1.8/rubygems
install config_file.rb
/home/mef/ruby/geminstall/local/lib/site_ruby/1.8/rubygems
install custom_require.rb
/home/mef/ruby/geminstall/local/lib/site_ruby/1.8/rubygems
install dependency_list.rb
/home/mef/ruby/geminstall/local/lib/site_ruby/1.8/rubygems
install doc_manager.rb
/home/mef/ruby/geminstall/local/lib/site_ruby/1.8/rubygems
install format.rb
/home/mef/ruby/geminstall/local/lib/site_ruby/1.8/rubygems
install gem_commands.rb
/home/mef/ruby/geminstall/local/lib/site_ruby/1.8/rubygems
install gem_openssl.rb
/home/mef/ruby/geminstall/local/lib/site_ruby/1.8/rubygems
install gem_runner.rb
/home/mef/ruby/geminstall/local/lib/site_ruby/1.8/rubygems
install incremental_fetcher.rb
/home/mef/ruby/geminstall/local/lib/site_ruby/1.8/rubygems
install installer.rb
/home/mef/ruby/geminstall/local/lib/site_ruby/1.8/rubygems
install loadpath_manager.rb
/home/mef/ruby/geminstall/local/lib/site_ruby/1.8/rubygems
install old_format.rb
/home/mef/ruby/geminstall/local/lib/site_ruby/1.8/rubygems
install open-uri.rb
/home/mef/ruby/geminstall/local/lib/site_ruby/1.8/rubygems
install package.rb
/home/mef/ruby/geminstall/local/lib/site_ruby/1.8/rubygems
install remote_installer.rb
/home/mef/ruby/geminstall/local/lib/site_ruby/1.8/rubygems
install rubygems_version.rb
/home/mef/ruby/geminstall/local/lib/site_ruby/1.8/rubygems
install security.rb
/home/mef/ruby/geminstall/local/lib/site_ruby/1.8/rubygems
install source_index.rb
/home/mef/ruby/geminstall/local/lib/site_ruby/1.8/rubygems
install specification.rb
/home/mef/ruby/geminstall/local/lib/site_ruby/1.8/rubygems
install timer.rb
/home/mef/ruby/geminstall/local/lib/site_ruby/1.8/rubygems
install user_interaction.rb
/home/mef/ruby/geminstall/local/lib/site_ruby/1.8/rubygems
install validator.rb
/home/mef/ruby/geminstall/local/lib/site_ruby/1.8/rubygems
install version.rb
/home/mef/ruby/geminstall/local/lib/site_ruby/1.8/rubygems
<— lib/rubygems
<— lib

As of RubyGems 0.8.0, library stubs are no longer needed.
Searching $LOAD_PATH for stubs to optionally delete (may take a
while)…
…done.
No library stubs found.

Successfully built RubyGem
Name: sources
Version: 0.0.1
File: sources-0.0.1.gem
[email protected]:~/temp/rubygems-0.9.0$ export
PATH=$PATH:/home/mef/ruby/geminstall/bin
[email protected]:~/temp/rubygems-0.9.0$ export GEM_PATH=/home/mef/ruby/gems
[email protected]:~/temp/rubygems-0.9.0$ gem query
/home/mef/ruby/geminstall/bin/gem:9:in `require’: no such file to load
– rubygems (LoadError)
from /home/mef/ruby/geminstall/bin/gem:9

Anyone have any ideas?

Mike Ferrier wrote:

Hi, I’m trying to use a .gem on a machine that I do not have root
permissions on. I’ve been following
http://wiki.rubyonrails.org/rails/pages/HowToUseMultipleGemRepositories
to install gem locally, but no matter what I do I always seem to end up
with: “/gem:9:in `require’: no such file to load – rubygems
(LoadError)”.

Try setting

export RUBYLIB=/home/mef/ruby/geminstall/local/lib/site_ruby/1.8

That way Ruby knows where to pick up your installed version of RubyGems.

– Jim W.

Jim W. wrote:

Mike Ferrier wrote:

Hi, I’m trying to use a .gem on a machine that I do not have root
permissions on. I’ve been following
http://wiki.rubyonrails.org/rails/pages/HowToUseMultipleGemRepositories
to install gem locally, but no matter what I do I always seem to end up
with: “/gem:9:in `require’: no such file to load – rubygems
(LoadError)”.

Try setting

export RUBYLIB=/home/mef/ruby/geminstall/local/lib/site_ruby/1.8

That way Ruby knows where to pick up your installed version of RubyGems.

– Jim W.

Thanks Jim, that worked.

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs