这在一两天前开始随机发生。以下是部署成功并构建段塞后CI日志的内容:
Restarting Heroku...
/mnt/home/u2144/bundle/ruby/2.0.0/gems/json-1.8.1/lib/json/common.rb:67: [BUG] Segmentation fault
ruby 1.9.3p0 (2011-10-30 revision 33570) [x86_64-linux]
接着是一堆堆栈跟踪的东西:
-- Ruby level backtrace information ----------------------------------------
/usr/bin/heroku:25:in `<main>'
/usr/local/heroku/lib/heroku/cli.rb:27:in `start'
/usr/local/heroku/lib/heroku/command.rb:13:in `load'
/usr/local/heroku/lib/heroku/command.rb:13:in `each'
/usr/local/heroku/lib/heroku/command.rb:14:in `block in load'
/usr/local/heroku/lib/heroku/command.rb:14:in `require'
/usr/local/heroku/lib/heroku/command/ps.rb:2:in `<top (required)>'
/usr/local/heroku/lib/heroku/command/ps.rb:2:in `require'
/mnt/home/u2144/bundle/ruby/2.0.0/gems/json-1.8.1/lib/json.rb:54:in `<top (required)>'
/mnt/home/u2144/bundle/ruby/2.0.0/gems/json-1.8.1/lib/json.rb:58:in `<module:JSON>'
/mnt/home/u2144/bundle/ruby/2.0.0/gems/json-1.8.1/lib/json.rb:58:in `require'
/mnt/home/u2144/bundle/ruby/2.0.0/gems/json-1.8.1/lib/json/ext.rb:9:in `<top (required)>'
/mnt/home/u2144/bundle/ruby/2.0.0/gems/json-1.8.1/lib/json/ext.rb:12:in `<module:JSON>'
/mnt/home/u2144/bundle/ruby/2.0.0/gems/json-1.8.1/lib/json/ext.rb:17:in `<module:Ext>'
/mnt/home/u2144/bundle/ruby/2.0.0/gems/json-1.8.1/lib/json/common.rb:67:in `generator='
/mnt/home/u2144/bundle/ruby/2.0.0/gems/json-1.8.1/lib/json/common.rb:67:in `new'
/mnt/home/u2144/bundle/ruby/2.0.0/gems/json-1.8.1/lib/json/common.rb:67:in `initialize'
它似乎还显示了大量Ruby 1.9.1正在使用的东西:
-- Other runtime information -----------------------------------------------
* Loaded script: /usr/bin/heroku
* Loaded features:
0 enumerator.so
1 /usr/lib/ruby/1.9.1/x86_64-linux/enc/encdb.so
2 /usr/lib/ruby/1.9.1/x86_64-linux/enc/trans/transdb.so
3 /usr/lib/ruby/1.9.1/rubygems/defaults.rb
4 /usr/lib/ruby/1.9.1/x86_64-linux/rbconfig.rb
5 /usr/lib/ruby/1.9.1/rubygems/deprecate.rb
6 /usr/lib/ruby/1.9.1/rubygems/exceptions.rb
7 /usr/lib/ruby/1.9.1/rubygems/custom_require.rb
8 /usr/lib/ruby/1.9.1/rubygems.rb
9 /usr/lib/ruby/1.9.1/x86_64-linux/pathname.so
10 /usr/lib/ruby/1.9.1/pathname.rb
11 /usr/lib/ruby/1.9.1/rubygems/user
我的gemfile指定了Ruby '2.0.0'
,所以我不明白发生了什么。这是一个Heroku错误吗?还是我应该尝试使用不同的gem来修复它?
这是因为我有一些东西导致Heroku使用Ruby 1.9.3。从命令行:
bundle exec heroku restart
> Your Ruby version is 1.9.3, but your Gemfile specified 2.0.0
我使用RVM切换到使用Ruby 2.0,这个警告就消失了。然而,我的CI部署仍然被破坏。然后我把它从使用bundle exec heroku...
切换到只使用heroku...
,一切都很好。