迁移到rubinius

时间:2013-11-27 16:50:17

标签: ruby rubinius

我正在尝试将项目从mri迁移到rubinius以获得并发优势。

我已启动服务器并打开第一页然后出错:

Puma caught this error: undefined method `=~' for Pathname (NameError)
kernel/common/module.rb:212:in `instance_method'
kernel/common/module.rb:354:in `undef_method'
kernel/bootstrap/array.rb:66:in `each'
kernel/common/module.rb:352:in `undef_method'
...

我的Gemfile

source 'https://rubygems.org'

ruby '2.1.0', :engine => "rbx", engine_version: '2.2.1'

gem "rubysl" # Ruby Standard Library meta-gem for rubinius

# Server requirements

gem 'puma'

...

这里可能有什么问题?

更新:full stack trace

1 个答案:

答案 0 :(得分:2)

我检查了你的堆栈跟踪并查看了Rubinius源代码。违规行是:

 class Pathname
   undef =~ # THIS IS IT
 end

#=~Object上的实例方法,所以通常undef =~应该适用于任何类... ,除非它已undef& #39; d已Object或已Pathname

我想知道这是否发生,因为你的Gemfile中有rubysl gem。我不认识Rubinius,但从我所看到的情况来看,它似乎并不需要你专门包含这个宝石。或者它可能在过去的版本中做过,但现在还没有。如果标准库被加载两次,那将解释为什么undef =~第二次失败。

如果这没有帮助,我建议您尝试暂时删除尽可能多的宝石,看看问题是否消失。如果是这样,请逐个添加它们,直到找到导致问题的那个。