From: "Carlo E. Prelz" Date: 2013-01-11T18:45:44+09:00 Subject: Re: Installing and using ruby gems without root privileges Subject: Installing and using ruby gems without root privileges Date: Fri 11 Jan 13 06:39:21PM +0900 Quoting Arseni Anisimovich (aruseni@gmail.com): > I'm working on a remote server on which I don't have root access. In my > work (which by now doesn't involve other server users) I need to install > some gems, but due to access limitations I cannot ask root to install them > and/or install them from my current user. > > I followed that guide: > http://ptspts.blogspot.com/2009/03/how-to-set-up-ruby-gems-on-debian-etch.html(since > we're using Debian), and I managed to install gems into custom > directory, but when I try to 'require' them in my scripts, following > happens (using weibo2 by acenqiu as an example): > > /weibo_crawler > ./weibo_crawler:3:in `require': no such file to load -- weibo2 (LoadError) > from ./weibo_crawler:3 ... ... > env: > ... > GEM_HOME=/home/anisimovich/gems > ... When you require something, you do not require a gem. You require either a .rb (ruby source) file or a .so (library) file. Ruby searches these files in standard directories, plus in those included in environment RUBYLIB. Look at where, under /home/anisimovich/gems, the weibo.rb or weibo.so file is, and add that directory to the content of RUBYLIB. Carlo -- * Se la Strada e la sua Virtu' non fossero state messe da parte, * K * Carlo E. Prelz - fluido@fluido.as che bisogno ci sarebbe * di parlare tanto di amore e di rettitudine? (Chuang-Tzu)