# Gems on shared server

**URL:** <https://www.ruby-forum.com/t/gems-on-shared-server/130615>\
**Category:** Rails\
**Created:** [February 29, 2008, 9:50pm UTC](https://www.ruby-forum.com/t/gems-on-shared-server/130615 "2008-02-29T21:50:39Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![chrisolsen](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/c6cbf5/32.png) [@chrisolsen](https://www.ruby-forum.com/u/chrisolsen)\
**Post date:** [February 29, 2008, 9:50pm UTC](https://www.ruby-forum.com/t/gems-on-shared-server/130615/1 "2008-02-29T21:50:39Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![chrisolsen](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/c6cbf5/32.png) [@chrisolsen](https://www.ruby-forum.com/u/chrisolsen)\
**Post date:** [February 29, 2008, 10:30pm UTC](https://www.ruby-forum.com/t/gems-on-shared-server/130615/2 "2008-02-29T22:30:48Z")

</div>

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](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

---

<div class="post-metadata">

**Author:** ![chrisolsen](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/c6cbf5/32.png) [@chrisolsen](https://www.ruby-forum.com/u/chrisolsen)\
**Post date:** [February 29, 2008, 10:48pm UTC](https://www.ruby-forum.com/t/gems-on-shared-server/130615/3 "2008-02-29T22:48:02Z")

</div>

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:

[XXX@xxx ~]$ gem install --install-dir /home/user\_name/gems GoogleCharts  
Bulk updating Gem source index for: [http://gems.rubyforge.org](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.

---

<div class="post-metadata">

**Author:** ![chrisolsen](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/c6cbf5/32.png) [@chrisolsen](https://www.ruby-forum.com/u/chrisolsen)\
**Post date:** [February 29, 2008, 10:59pm UTC](https://www.ruby-forum.com/t/gems-on-shared-server/130615/4 "2008-02-29T22:59:05Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![chrisolsen](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/c6cbf5/32.png) [@chrisolsen](https://www.ruby-forum.com/u/chrisolsen)\
**Post date:** [February 29, 2008, 11:37pm UTC](https://www.ruby-forum.com/t/gems-on-shared-server/130615/5 "2008-02-29T23:37:45Z")

</div>

Thanks Craig setting of the loadpaths did it.

---

<div class="post-metadata">

**Author:** ![chrisolsen](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/c6cbf5/32.png) [@chrisolsen](https://www.ruby-forum.com/u/chrisolsen)\
**Post date:** [February 29, 2008, 10:56pm UTC](https://www.ruby-forum.com/t/gems-on-shared-server/130615/6 "2008-02-29T22:56:09Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![chrisolsen](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/c6cbf5/32.png) [@chrisolsen](https://www.ruby-forum.com/u/chrisolsen)\
**Post date:** [March 1, 2008, 2:12am UTC](https://www.ruby-forum.com/t/gems-on-shared-server/130615/7 "2008-03-01T02:12:01Z")

</div>

> 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](http://forums.site5.com/showthread.php?t=11954)
