我正在尝试安装这个:
但sudo gem install travis
我收到此错误:
ERROR: Error installing travis:
ERROR: Failed to build gem native extension.
current directory: /var/lib/gems/2.3.0/gems/ffi-1.9.18/ext/ffi_c
/usr/bin/ruby2.3 -r ./siteconf20170310-8171-xumwrs.rb extconf.rb
mkmf.rb can't find header files for ruby at /usr/lib/ruby/include/ruby.h
extconf failed, exit code 1
Gem files will remain installed in /var/lib/gems/2.3.0/gems/ffi-1.9.18 for inspection.
Results logged to /var/lib/gems/2.3.0/extensions/x86_64-linux/2.3.0/ffi-1.9.18/gem_make.out
我如何删除已安装的内容并正确安装它?
答案1
我在尝试安装 travis 时也遇到了类似的问题。ruby-dev
我的系统中没有安装。安装后,我重新运行了安装 travis 的命令ruby-dev
。
我ruby-dev
使用下面的命令进行安装。
sudo apt-get install ruby-dev
我参考了这个答案。希望对您有帮助。https://stackoverflow.com/questions/4304438/gem-install-failed-to-build-gem-native-extension-cant-find-header-files