bioruby-samtools icon indicating copy to clipboard operation
bioruby-samtools copied to clipboard

Supported ruby versions undeclared in gemspec, ext/Rakefile unsupported with ruby 2.4.2

Open MatthewRalston opened this issue 7 years ago • 1 comments

To avoid the Open-URI redirection issue described in #67, I tried installing the 2.3.0 gem for ruby version 2.4.2. In this case, the redirection is successful, but the rake still fails with a nameerror from Config=>RbConfig constant incompatability between ruby versions. Shouldn't the appropriate ruby versions be declared in the gemspec?

cd samtools-0.1.19
patch < ../Makefile-bioruby.patch
patching file Makefile
patch < ../Makefile-suse.patch
patching file Makefile
Hunk #1 succeeded at 15 with fuzz 1 (offset 2 lines).
rake aborted!
NameError: uninitialized constant Config
Did you mean?  RbConfig
/home/matt/.rvm/gems/ruby-2.4.2@ngsci/gems/bio-samtools-2.3.0/ext/Rakefile:23:in `block (2 levels) in <top (required)>'
/home/matt/.rvm/gems/ruby-2.4.2@ngsci/gems/bio-samtools-2.3.0/ext/Rakefile:19:in `block in <top (required)>'
/home/matt/.rvm/gems/ruby-2.4.2@ngsci/gems/rake-12.2.1/exe/rake:27:in `<main>'
Tasks: TOP => default => compile
(See full trace by running task with --trace)

rake failed, exit code 1

MatthewRalston avatar Oct 28 '17 23:10 MatthewRalston

The actual issue in the source could be easily patched with the following, but a supported ruby version(s) statement should be included in the gemspec.

cfgConstant = Kernel.const_defined?('RbConfig') ? 'RbConfig' : 'Config'

...

case #{cfgConstant}::CONFIG['host_os']

MatthewRalston avatar Oct 30 '17 19:10 MatthewRalston