[BioRuby] installing bio::graphics
Jan Aerts
jan.aerts at bbsrc.ac.uk
Fri Mar 14 13:23:24 UTC 2008
Hey Robert,
Sorry for not getting back to you earlier; this post completely slipped
my system...
I'm actually not completely sure why that does not work, although I can
make an educated guess. (Getting the environment right is one of the
most troublesome things for ruby and other languages as well is _my_
experience...)
The thing is that 'bio' and 'bio-graphics' are released as gems. I think
you can do the "ruby -r xyz" trick with those libraries in
/usr/lib/ruby/1.8/. On my machine, this directory holds libraries such
as cairo.rb, getopts.rb, irb.rb and more than 150 others. Indeed:
rubygems.rb is there as well.
<getting a console and checking stuff>
And guess what: ruby -r cairo -e "puts 'hello'" _does_ work, as opposed
to the example with -r bio.
What also works, is:
ruby -r rubygems -e "require 'bio'; puts 'hello'"
However,
ruby -r rubygems -r bio -e "puts 'hello'"
does not work. Guess that is because rubygems is not actually loaded yet
at the moment that ruby tries to load bio.
Does this help?
j.
Dr Jan Aerts
Bioinformatics Group
Roslin Institute
Roslin EH25 9PS
Scotland, UK
tel: +44 131 527 4198
----...and the obligatory disclaimer----
Roslin Institute is a company limited by guarantee, registered in
Scotland (registered number SC157100) and a Scottish Charity (registered
number SC023592). Our registered office is at Roslin, Midlothian, EH25
9PS. VAT registration number 847380013.
The information contained in this e-mail (including any attachments) is
confidential and is intended for the use of the addressee only. The
opinions expressed within this e-mail (including any attachments) are
the opinions of the sender and do not necessarily constitute those of
Roslin Institute (Edinburgh) ("the Institute") unless specifically
stated by a sender who is duly authorised to do so on behalf of the
Institute.
Robert Citek wrote:
> On Thu, Feb 14, 2008 at 10:30 PM, jan aerts (RI) <jan.aerts at bbsrc.ac.uk> wrote:
>> Does this help: http://ericbeland.com/2007/12/20/uninitialized-constant-gem-gemrunner ?
>
> Thanks, Jan. That made gem work. Complete notes here:
>
> http://ubuntuforums.org/showthread.php?p=4462021#post4462021
>
> Now on to bio-graphics:
>
> $ sudo apt-get install libpango1-ruby libcairo-ruby
>
> $ sudo gem install bio
> Bulk updating Gem source index for: http://gems.rubyforge.org
> Successfully installed bio-1.2.1
> 1 gem installed
>
> $ sudo gem install bio-graphics
> Successfully installed bio-graphics-1.4
> 1 gem installed
> Installing ri documentation for bio-graphics-1.4...
> Installing RDoc documentation for bio-graphics-1.4...
>
> $ gem list
>
> *** LOCAL GEMS ***
>
> bio (1.2.1)
> bio-graphics (1.4)
> rubygems-update (1.0.1)
>
> So far so good. But I don't understand the following results:
>
> $ true ; ( set -x
> ruby -e "p 'hello'"
> ruby -rbio -e "p 'hello'"
> ruby -e "require 'bio'; puts 'hello' "
> export RUBYOPT=rubygems
> ruby -e "require 'bio'; puts 'hello' "
> ruby -e "require 'bio'; require 'bio-graphics' ; puts 'hello' "
> ruby -rbio -e "p 'hello'"
> ) >& output.txt
>
> $ cat output.txt
> + ruby -e 'p '\''hello'\'''
> "hello"
> + ruby -rbio -e 'p '\''hello'\'''
> ruby: no such file to load -- bio (LoadError)
> + ruby -e 'require '\''bio'\''; puts '\''hello'\'' '
> -e:1:in `require': no such file to load -- bio (LoadError)
> from -e:1
> + export RUBYOPT=rubygems
> + RUBYOPT=rubygems
> + ruby -e 'require '\''bio'\''; puts '\''hello'\'' '
> hello
> + ruby -e 'require '\''bio'\''; require '\''bio-graphics'\'' ; puts
> '\''hello'\'' '
> hello
> + ruby -rbio -e 'p '\''hello'\'''
> ruby: no such file to load -- bio (LoadError)
>
> So, the good new is that it seems as though I now have bio-graphics installed.
>
> Now the question I have is, is there any reason why the -r option
> does not seem to work as expected, i.e. doesn't load the bio library?
>
> Regards,
> - Robert
> _______________________________________________
> BioRuby mailing list
> BioRuby at lists.open-bio.org
> http://lists.open-bio.org/mailman/listinfo/bioruby
More information about the BioRuby
mailing list