Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Ruby > Ruby Libraries (and Leopard)

Reply
Thread Tools

Ruby Libraries (and Leopard)

 
 
Peter Laurens
Guest
Posts: n/a
 
      11-13-2007
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/).

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/.

 
Reply With Quote
 
 
 
 
Casimir
Guest
Posts: n/a
 
      11-14-2007
Peter Laurens kirjoitti:
> I downloaded ruby-svg (from
> 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 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

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/documenta...n1/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
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
standard libraries don't behave like standard 'libraries' Sriram Srinivasan Python 13 11-12-2009 06:05 PM
Using mandatory libraries (custom class loading vs. expanding libraries) Karsten Wutzke Java 21 06-29-2007 09:25 PM
Ruby must run in c:\ruby in order to find libraries (xp sp2) zenix Ruby 0 04-28-2007 03:55 PM
#!/usr/bin/ruby , #!/usr/bin/ruby -w , #!/usr/bin/ruby -T?, #!/usr/bin/ruby -T1... anne001 Ruby 1 04-23-2006 03:02 PM
Ruby Libraries [was Opportunities and pitfalls; was "Introducing myself - Sascha Ebach"] Curt Hibbs Ruby 0 04-30-2004 08:23 PM



Advertisments