Gems on shared server

To use gems on a shared server do I have to get the server admin to
install it for me? Or is there another way?

In a small project I use GoogleCharts and fastercsv which were only
available as gems and not rails plugins.

Thanks

I asked a somewhat similar question…here’s the link (hopefully it
works) to the thread.
http://groups.google.com/group/rubyonrails-talk/browse_thread/thread/75171bb6583b08eb

The response I got seemed to indicate that you can indeed put gems in
another directory & point ruby at them with a -I switch…or modify
$LOAD_PATH to get at the gems.

Also I ran across the gemsonrails plugin, but I failed to get it to
work for me. (when I ran my custom rake deploy it flagged an error
saying I needed to specify a loadpath).

I would’ve thought that rake rails:freeze:gems would’ve solved all of
these problems (I’m guessing you’ve tried that with your app).
-Dale

I didn’t realize that it was trying to install to a local dir, ie the
–install-dir parameter was to my ~/gems dir. So the problem isn’t what
I thought it was. Now I just can’t install them.

When I try to install a gem I get the following:

[[email protected] ~]$ gem install --install-dir /home/user_name/gems GoogleCharts
Bulk updating Gem source index for: http://gems.rubyforge.org
/usr/lib/ruby/1.8/yaml.rb:133: [BUG] Segmentation fault
ruby 1.8.4 (2005-12-24) [i386-linux]

Aborted (core dumped)

I get the same message if I leave the --install-dir blank, which
defaults to /home/user…/gems

This may be more of a question for the people managing the server.

On Fri, 2008-02-29 at 22:48 +0100, Chris O. wrote:

Aborted (core dumped)

I get the same message if I leave the --install-dir blank, which
defaults to /home/user…/gems

This may be more of a question for the people managing the server.


by the way…you have to be root to install gems.

you might be able to download the gem separately and just locate it
where you want but some gems need to be ‘built’

Craig

Thanks Craig setting of the loadpaths did it.

On Fri, 2008-02-29 at 22:48 +0100, Chris O. wrote:

Aborted (core dumped)

I get the same message if I leave the --install-dir blank, which
defaults to /home/user…/gems

This may be more of a question for the people managing the server.


this may or may not be useful to you but what I did to make a ‘gem’
portable was to install the gem normally on my development system and
then unpacked it locally…

gem unpack icalendar
mv icalendar vendor/gems/

Note: changes to environment.rb…

config.load_paths += %W( #{RAILS_ROOT}/vendor/gems/icalendar/lib )

Craig

by the way…you have to be root to install gems.

Not quite true. You can install gems for your own use if you have a
shell account. There may be a few exceptions. You do have to be the root
to install a system wide gems.

More details here:

http://forums.site5.com/showthread.php?t=11954