[BioRuby] R: Ruby 1.9.2 and BioRuby

Raoul Bonnal bonnalraoul at ingm.it
Mon Sep 27 13:25:00 UTC 2010


It's a problem of loading path. In Ruby 1.9.2 the '.' is not loaded by default.
Adding the $:<<'.' Seems to patch the problem.
I did some test and probably 

In activerecord, for instance, they do in this way.


activesupport_path = File.expand_path('../../../activesupport/lib', __FILE__)
$:.unshift(activesupport_path) if File.directory?(activesupport_path) && !$:.include?(activesupport_path)

activemodel_path = File.expand_path('../../../activemodel/lib', __FILE__)
$:.unshift(activemodel_path) if File.directory?(activemodel_path) && !$:.include?(activemodel_path)

require 'active_support'
require 'active_support/i18n'
require 'active_model'
require 'arel'
--
Raoul J.P. Bonnal
Life Science Informatics
Integrative Biology Program
Fondazione INGM
Via F. Sforza 28
20122 Milano, IT
phone: +39 02 006 623  26
fax: +39 02 006 623 46
http://www.ingm.it


> -----Messaggio originale-----
> Da: Raoul Bonnal [mailto:bonnalraoul at ingm.it]
> Inviato: lunedì 27 settembre 2010 15:11
> A: 'Raoul Bonnal'; bioruby at lists.open-bio.org
> Oggetto: R: [BioRuby] Ruby 1.9.2 and BioRuby
> 
> And ... it works on 1.8.7 and 1.9.1
> 
> --
> Raoul J.P. Bonnal
> Life Science Informatics
> Integrative Biology Program
> Fondazione INGM
> Via F. Sforza 28
> 20122 Milano, IT
> phone: +39 02 006 623  26
> fax: +39 02 006 623 46
> http://www.ingm.it
> 
> 
> > -----Messaggio originale-----
> > Da: bioruby-bounces at lists.open-bio.org [mailto:bioruby-
> > bounces at lists.open-bio.org] Per conto di Raoul Bonnal
> > Inviato: lunedì 27 settembre 2010 12:53
> > A: bioruby at lists.open-bio.org
> > Oggetto: [BioRuby] Ruby 1.9.2 and BioRuby
> >
> > Hello guys,
> > Do you have any idea how to solve this error?
> > /home/ra/.rvm/gems/ruby-1.9.2-p0/gems/activesupport-
> > 3.0.0/lib/active_support/dependencies.rb:479:in
> > `load_missing_constant': Bio is not missing constant Sequence!
> > (ArgumentError)
> >         from /home/ra/.rvm/gems/ruby-1.9.2-p0/gems/activesupport-
> > 3.0.0/lib/active_support/dependencies.rb:183:in `block in
> > const_missing'
> >         from /home/ra/.rvm/gems/ruby-1.9.2-p0/gems/activesupport-
> > 3.0.0/lib/active_support/dependencies.rb:181:in `each'
> >         from /home/ra/.rvm/gems/ruby-1.9.2-p0/gems/activesupport-
> > 3.0.0/lib/active_support/dependencies.rb:181:in `const_missing'
> >         from /home/ra/deve/bioruby/lib/bio/sequence/compat.rb:15:in
> > `<module:Bio>'
> >         from /home/ra/deve/bioruby/lib/bio/sequence/compat.rb:13:in
> > `<top (required)>'
> >         from <internal:lib/rubygems/custom_require>:29:in `require'
> >         from <internal:lib/rubygems/custom_require>:29:in `require'
> >         from /home/ra/.rvm/gems/ruby-1.9.2-p0/gems/activesupport-
> > 3.0.0/lib/active_support/dependencies.rb:239:in `block in require'
> >         from /home/ra/.rvm/gems/ruby-1.9.2-p0/gems/activesupport-
> > 3.0.0/lib/active_support/dependencies.rb:225:in `block in
> > load_dependency'
> >         from /home/ra/.rvm/gems/ruby-1.9.2-p0/gems/activesupport-
> > 3.0.0/lib/active_support/dependencies.rb:591:in `new_constants_in'
> >         from /home/ra/.rvm/gems/ruby-1.9.2-p0/gems/activesupport-
> > 3.0.0/lib/active_support/dependencies.rb:225:in `load_dependency'
> >         from /home/ra/.rvm/gems/ruby-1.9.2-p0/gems/activesupport-
> > 3.0.0/lib/active_support/dependencies.rb:239:in `require'
> >         from /home/ra/deve/bioruby/lib/bio/sequence.rb:15:in `<top
> > (required)>'
> >         from /home/ra/deve/bioruby/lib/bio/shell/plugin/midi.rb:20:in
> > `<top (required)>'
> >         from <internal:lib/rubygems/custom_require>:29:in `require'
> >         from <internal:lib/rubygems/custom_require>:29:in `require'
> >         from /home/ra/.rvm/gems/ruby-1.9.2-p0/gems/activesupport-
> > 3.0.0/lib/active_support/dependencies.rb:239:in `block in require'
> >         from /home/ra/.rvm/gems/ruby-1.9.2-p0/gems/activesupport-
> > 3.0.0/lib/active_support/dependencies.rb:225:in `block in
> > load_dependency'
> >         from /home/ra/.rvm/gems/ruby-1.9.2-p0/gems/activesupport-
> > 3.0.0/lib/active_support/dependencies.rb:591:in `new_constants_in'
> >         from /home/ra/.rvm/gems/ruby-1.9.2-p0/gems/activesupport-
> > 3.0.0/lib/active_support/dependencies.rb:225:in `load_dependency'
> >         from /home/ra/.rvm/gems/ruby-1.9.2-p0/gems/activesupport-
> > 3.0.0/lib/active_support/dependencies.rb:239:in `require'
> >         from /home/ra/deve/bioruby/lib/bio/shell.rb:29:in
> > `<module:Shell>'
> >         from /home/ra/deve/bioruby/lib/bio/shell.rb:17:in `<top
> > (required)>'
> >         from <internal:lib/rubygems/custom_require>:29:in `require'
> >         from <internal:lib/rubygems/custom_require>:29:in `require'
> >         from /home/ra/.rvm/gems/ruby-1.9.2-p0/gems/activesupport-
> > 3.0.0/lib/active_support/dependencies.rb:239:in `block in require'
> >         from /home/ra/.rvm/gems/ruby-1.9.2-p0/gems/activesupport-
> > 3.0.0/lib/active_support/dependencies.rb:225:in `block in
> > load_dependency'
> >         from /home/ra/.rvm/gems/ruby-1.9.2-p0/gems/activesupport-
> > 3.0.0/lib/active_support/dependencies.rb:591:in `new_constants_in'
> >         from /home/ra/.rvm/gems/ruby-1.9.2-p0/gems/activesupport-
> > 3.0.0/lib/active_support/dependencies.rb:225:in `load_dependency'
> >         from /home/ra/.rvm/gems/ruby-1.9.2-p0/gems/activesupport-
> > 3.0.0/lib/active_support/dependencies.rb:239:in `require'
> >         from /home/ra/deve/bioruby/bin/bioruby:18:in `<main>'
> >
> > --
> > Raoul J.P. Bonnal
> > Life Science Informatics
> > Integrative Biology Program
> > Fondazione INGM
> > Via F. Sforza 28
> > 20122 Milano, IT
> > phone: +39 02 006 623  26
> > fax: +39 02 006 623 46
> > http://www.ingm.it
> >
> >
> >
> >
> > _______________________________________________
> > BioRuby Project - http://www.bioruby.org/
> > BioRuby mailing list
> > BioRuby at lists.open-bio.org
> > http://lists.open-bio.org/mailman/listinfo/bioruby





More information about the BioRuby mailing list