ruby 2.0.0p247(2013-06-27 修订版 41674)[x86_64-linux]
宝石 2.0.3
sudo gem install travis
Building native extensions. This could take a while...
ERROR: Error installing travis:
ERROR: Failed to build gem native extension.
/usr/bin/ruby1.9.1 extconf.rb
/usr/lib/ruby/1.9.1/rubygems/custom_require.rb:36:in `require': cannot load such file -- mkmf (LoadError)
from /usr/lib/ruby/1.9.1/rubygems/custom_require.rb:36:in `require'
from extconf.rb:4:in `<main>'
Gem files will remain installed in /var/lib/gems/1.9.1/gems/ffi-1.9.0 for inspection.
Results logged to /var/lib/gems/1.9.1/gems/ffi-1.9.0/ext/ffi_c/gem_make.out
尝试安装其他 gem 时也会遇到这种情况。我不是 Ruby 用户,谷歌搜索错误并没有给我任何有效的解决方案。
我使用 RVM 安装了 Ruby 2.0:“curl -L https://get.rvm.io | bash -s stable --ruby”。
如果我执行“sudo ruby -v”,我会得到“ruby 1.9.3p194(2012-04-20 修订版 35410)[x86_64-linux]”。