# Ruby Libraries (and Leopard)

**URL:** <https://rubytalk.org/t/ruby-libraries-and-leopard/42168>\
**Category:** ruby-talk\
**Created:** [13 November 2007 15:55 UTC](https://rubytalk.org/t/ruby-libraries-and-leopard/42168 "2007-11-13T15:55:23Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Peter\_Laurens](https://avatars.discourse-cdn.com/v4/letter/p/9fc29f/32.png) [@Peter\_Laurens](https://rubytalk.org/u/Peter_Laurens)\
**Post date:** [13 November 2007 15:55 UTC](https://rubytalk.org/t/ruby-libraries-and-leopard/42168/1 "2007-11-13T15:55:23Z")

</div>

Hi,

I am wanting to experiment with SVG with Ruby, and although there is no  
gem for SVG afaik, I downloaded ruby-svg (from  
[http://ruby-svg.sourceforge.jp/](http://ruby-svg.sourceforge.jp/)).

I followed the simple install instructions (just run a ruby script) and  
the install dumped an 'svg' folder with the ruby-svg files inside at my  
hard drive root (/svg).

This surprised me, and Ruby obviously can't find these files using  
"require 'svg/svg'", because Ruby isn't looking here. So I was wondering  
where the normal place to put Ruby libraries like this is (where does  
Ruby normally look).

I also think that this might be very different under Mac OS X Leopard,  
because Ruby ships with the OS in a 'frameworkised' version, so perhaps  
the library location is different?

Any help much appreciated,

Thanks.

> **···**
>
> --  
> Posted via [http://www.ruby-forum.com/](http://www.ruby-forum.com/).

---

<div class="post-metadata">

**Author:** ![Casimir](https://avatars.discourse-cdn.com/v4/letter/c/f17d59/32.png) [@Casimir](https://rubytalk.org/u/Casimir)\
**Post date:** [14 November 2007 13:50 UTC](https://rubytalk.org/t/ruby-libraries-and-leopard/42168/2 "2007-11-14T13:50:05Z")

</div>

Peter Laurens kirjoitti:

> I downloaded ruby-svg (from  
> [http://ruby-svg.sourceforge.jp/\](http://ruby-svg.sourceforge.jp/%5C)).
> 
> I followed the simple install instructions (just run a ruby script) and  
> the install dumped an 'svg' folder with the ruby-svg files inside at my  
> hard drive root (/svg).
> 
> This surprised me, and Ruby obviously can't find these files using  
> "require 'svg/svg'", because Ruby isn't looking here. So I was wondering  
> where the normal place to put Ruby libraries like this is (where does  
> Ruby normally look).

I am not sure about Leopard. But I used Yuya's SVG lib, it works nice. Thank you, Yuya!! Its what I used for the pieces in my portfolio 8)

There isn't much to install. I didnt run any install script. Simply copied the "svg"-directory to the same dir as my code. I suppose if you have a default library path in your PATH you would want to copy the uncompressed lib (folder) there.

See this:  
[http://developer.apple.com/documentation/Darwin/Reference/ManPages/man1/ruby.1.html](http://developer.apple.com/documentation/Darwin/Reference/ManPages/man1/ruby.1.html)

If you cant get it working otherwise, first uncompress the archive. Then copy the 'svg'-directory (inside 'lib') with all the content TO the same directory you have your ruby code in (say, for example sample1.rb). Require it in the code with "require 'svg/svg'". Finally compile from the same directory as your ruby code (and the svg-directory) with "ruby yourrubyscript.rb".

I hope that helps. Feel free to ask more.

Csmr  
[http://csmr.dreamhosters.com](http://csmr.dreamhosters.com)
