Bundler.require(:default) fails in Rubinius

216 views Asked by At

I have a very simple app, which i tried to run with Rubinius:

Gemfile:

source 'https://rubygems.org
gem 'rake'
gem 'tiny_tds'
gem 'sequel'

lib/database.rb:

require "rubygems"
require "bundler/setup"

Bundler.require(:default)

DB = Sequel.tinytds(:host => 'SQL2012', :user => "Rails", :password => "xxx", :database => "RailsTest")

test/connection_test.rb:

require_relative "../lib/database"

DB.fetch("SELECT TOP 10 * FROM User") do |row|
  puts row.to_s
end

Rakefile:

require 'rubygems'
require 'rake'
require 'rake/clean'
require 'rake/testtask'

Rake::TestTask.new do |t|
  t.test_files = FileList['test/**/*.rb']
end

task :default => :test

This runs fine with MRI 1.9.3 and MRI 2.1.0 but fails with rbx 2.2.2 :

klaus@rails-dev:$ rake test An exception occurred running /home2/klaus/.rvm/gems/rbx-2.2.2@global/gems/rake-10.1.1/lib/rake/rake_test_loader.rb:

no such file to load -- bigdecimal (LoadError)

Backtrace:

            Rubinius::CodeLoader#load_error at kernel/common/code_loader.rb:440
  Rubinius::CodeLoader#resolve_require_path at kernel/common/code_loader.rb:423
        { } in Rubinius::CodeLoader#require at kernel/common/code_loader.rb:103
                       Rubinius.synchronize at kernel/bootstrap/rubinius.rb:137
               Rubinius::CodeLoader#require at kernel/common/code_loader.rb:102
               Rubinius::CodeLoader.require at kernel/common/code_loader.rb:237
                     Kernel(Object)#require at kernel/common/kernel.rb:705
                          Object#__script__ at /home2/klaus/.rvm/gems/rbx-2.2.2/gems/tiny_tds-0.6.1/lib/tiny_tds.rb:3
               Rubinius::CodeLoader.require at kernel/common/code_loader.rb:243
                             Kernel.require at kernel/common/kernel.rb:705
            { } in Bundler::Runtime#require at /home2/klaus/.rvm/gems/rbx-2.2.2@global/gems/bundler-1.5.2/lib/bundler/runtime.rb:76
                                 Array#each at kernel/bootstrap/array.rb:66
            { } in Bundler::Runtime#require at /home2/klaus/.rvm/gems/rbx-2.2.2@global/gems/bundler-1.5.2/lib/bundler/runtime.rb:72
                                 Array#each at kernel/bootstrap/array.rb:66
                   Bundler::Runtime#require at /home2/klaus/.rvm/gems/rbx-2.2.2@global/gems/bundler-1.5.2/lib/bundler/runtime.rb:61
                            Bundler.require at /home2/klaus/.rvm/gems/rbx-2.2.2@global/gems/bundler-1.5.2/lib/bundler.rb:131
                          Object#__script__ at lib/database.rb:4
               Rubinius::CodeLoader.require at kernel/common/code_loader.rb:243
      Rubinius::CodeLoader.require_relative at kernel/common/code_loader.rb:143
            Kernel(Object)#require_relative at kernel/common/kernel.rb:711
                          Object#__script__ at test/connection_test.rb:2
               Rubinius::CodeLoader.require at kernel/common/code_loader.rb:243
Kernel(Object)#gem_original_require (require) at kernel/common/kernel.rb:705
                     Kernel(Object)#require at /home2/klaus/.rvm/rubies/rbx-2.2.2/site/rubygems/core_ext/kernel_require.rb:55
                   { } in Object#__script__ at /home2/klaus/.rvm/gems/rbx-2.2.2@global/gems/rake-10.1.1/lib/rake/rake_test_loader.rb:15
          { } in Enumerable(Array)#find_all at kernel/common/enumerable.rb:432
                                 Array#each at kernel/bootstrap/array.rb:66
        Enumerable(Array)#select (find_all) at kernel/common/enumerable.rb:430
                          Object#__script__ at /home2/klaus/.rvm/gems/rbx-2.2.2@global/gems/rake-10.1.1/lib/rake/rake_test_loader.rb:4
           Rubinius::CodeLoader#load_script at kernel/delta/code_loader.rb:66
           Rubinius::CodeLoader.load_script at kernel/delta/code_loader.rb:200
                    Rubinius::Loader#script at kernel/loader.rb:649
                      Rubinius::Loader#main at kernel/loader.rb:831
rake aborted!
Command failed with status (1): [ruby -I"lib" -I"/home2/klaus/.rvm/gems/rbx-2.2.2@global/gems/rake-10.1.1/lib" "/home2/klaus/.rvm/gems/rbx-2.2.2@global/gems/rake-10.1.1/lib/rake/rake_test_loader.rb" "test/connection_test.rb" ]
kernel/bootstrap/proc.rb:20:in `call'
kernel/bootstrap/proc.rb:20:in `call'
kernel/bootstrap/array.rb:66:in `each'
kernel/bootstrap/array.rb:66:in `each'
kernel/common/kernel.rb:447:in `load'
kernel/delta/code_loader.rb:66:in `load_script'
kernel/delta/code_loader.rb:200:in `load_script'
kernel/loader.rb:649:in `script'
kernel/loader.rb:831:in `main'
Tasks: TOP => test
(See full trace by running task with --trace)
1

There are 1 answers

0
Jeremy Evans On BEST ANSWER

You probably need to add bigdecimal or rubysl to your Gemfile. rubinius has gemified their stdlib, causing issues similar to this one.