安装与RVM红宝石头(Install ruby headers with rvm)

2019-07-30 12:38发布

特拉维斯CI使用RVM提供的Ruby,但它doen't似乎包含头文件:

$ find /home/vagrant/.rvm/rubies/ruby-1.9.3-p194/lib/ruby/1.9.1/i686-linux
/home/vagrant/.rvm/rubies/ruby-1.9.3-p194/lib/ruby/1.9.1/i686-linux
/home/vagrant/.rvm/rubies/ruby-1.9.3-p194/lib/ruby/1.9.1/i686-linux/zlib.so
/home/vagrant/.rvm/rubies/ruby-1.9.3-p194/lib/ruby/1.9.1/i686-linux/dl.so
/home/vagrant/.rvm/rubies/ruby-1.9.3-p194/lib/ruby/1.9.1/i686-linux/syck.so
/home/vagrant/.rvm/rubies/ruby-1.9.3-p194/lib/ruby/1.9.1/i686-linux/socket.so
/home/vagrant/.rvm/rubies/ruby-1.9.3-p194/lib/ruby/1.9.1/i686-linux/dbm.so
/home/vagrant/.rvm/rubies/ruby-1.9.3-p194/lib/ruby/1.9.1/i686-linux/pty.so
/home/vagrant/.rvm/rubies/ruby-1.9.3-p194/lib/ruby/1.9.1/i686-linux/strscan.so
/home/vagrant/.rvm/rubies/ruby-1.9.3-p194/lib/ruby/1.9.1/i686-linux/io
/home/vagrant/.rvm/rubies/ruby-1.9.3-p194/lib/ruby/1.9.1/i686-linux/io/console.so
/home/vagrant/.rvm/rubies/ruby-1.9.3-p194/lib/ruby/1.9.1/i686-linux/io/wait.so
/home/vagrant/.rvm/rubies/ruby-1.9.3-p194/lib/ruby/1.9.1/i686-linux/io/nonblock.so
/home/vagrant/.rvm/rubies/ruby-1.9.3-p194/lib/ruby/1.9.1/i686-linux/iconv.so
/home/vagrant/.rvm/rubies/ruby-1.9.3-p194/lib/ruby/1.9.1/i686-linux/enc
/home/vagrant/.rvm/rubies/ruby-1.9.3-p194/lib/ruby/1.9.1/i686-linux/enc/iso_8859_14.so
/home/vagrant/.rvm/rubies/ruby-1.9.3-p194/lib/ruby/1.9.1/i686-linux/enc/gb2312.so
/home/vagrant/.rvm/rubies/ruby-1.9.3-p194/lib/ruby/1.9.1/i686-linux/enc/iso_8859_16.so
/home/vagrant/.rvm/rubies/ruby-1.9.3-p194/lib/ruby/1.9.1/i686-linux/enc/windows_1251.so
/home/vagrant/.rvm/rubies/ruby-1.9.3-p194/lib/ruby/1.9.1/i686-linux/enc/euc_jp.so
/home/vagrant/.rvm/rubies/ruby-1.9.3-p194/lib/ruby/1.9.1/i686-linux/enc/iso_8859_4.so
/home/vagrant/.rvm/rubies/ruby-1.9.3-p194/lib/ruby/1.9.1/i686-linux/enc/iso_8859_1.so
/home/vagrant/.rvm/rubies/ruby-1.9.3-p194/lib/ruby/1.9.1/i686-linux/enc/trans
/home/vagrant/.rvm/rubies/ruby-1.9.3-p194/lib/ruby/1.9.1/i686-linux/enc/trans/japanese_euc.so
/home/vagrant/.rvm/rubies/ruby-1.9.3-p194/lib/ruby/1.9.1/i686-linux/enc/trans/emoji_sjis_softbank.so
/home/vagrant/.rvm/rubies/ruby-1.9.3-p194/lib/ruby/1.9.1/i686-linux/enc/trans/single_byte.so
/home/vagrant/.rvm/rubies/ruby-1.9.3-p194/lib/ruby/1.9.1/i686-linux/enc/trans/emoji_sjis_docomo.so
/home/vagrant/.rvm/rubies/ruby-1.9.3-p194/lib/ruby/1.9.1/i686-linux/enc/trans/utf8_mac.so
/home/vagrant/.rvm/rubies/ruby-1.9.3-p194/lib/ruby/1.9.1/i686-linux/enc/trans/gbk.so
/home/vagrant/.rvm/rubies/ruby-1.9.3-p194/lib/ruby/1.9.1/i686-linux/enc/trans/emoji.so
/home/vagrant/.rvm/rubies/ruby-1.9.3-p194/lib/ruby/1.9.1/i686-linux/enc/trans/japanese_sjis.so
/home/vagrant/.rvm/rubies/ruby-1.9.3-p194/lib/ruby/1.9.1/i686-linux/enc/trans/big5.so
/home/vagrant/.rvm/rubies/ruby-1.9.3-p194/lib/ruby/1.9.1/i686-linux/enc/trans/transdb.so
/home/vagrant/.rvm/rubies/ruby-1.9.3-p194/lib/ruby/1.9.1/i686-linux/enc/trans/japanese.so
/home/vagrant/.rvm/rubies/ruby-1.9.3-p194/lib/ruby/1.9.1/i686-linux/enc/trans/gb18030.so
/home/vagrant/.rvm/rubies/ruby-1.9.3-p194/lib/ruby/1.9.1/i686-linux/enc/trans/utf_16_32.so
/home/vagrant/.rvm/rubies/ruby-1.9.3-p194/lib/ruby/1.9.1/i686-linux/enc/trans/korean.so
/home/vagrant/.rvm/rubies/ruby-1.9.3-p194/lib/ruby/1.9.1/i686-linux/enc/trans/escape.so
/home/vagrant/.rvm/rubies/ruby-1.9.3-p194/lib/ruby/1.9.1/i686-linux/enc/trans/emoji_iso2022_kddi.so
/home/vagrant/.rvm/rubies/ruby-1.9.3-p194/lib/ruby/1.9.1/i686-linux/enc/trans/chinese.so
/home/vagrant/.rvm/rubies/ruby-1.9.3-p194/lib/ruby/1.9.1/i686-linux/enc/trans/iso2022.so
/home/vagrant/.rvm/rubies/ruby-1.9.3-p194/lib/ruby/1.9.1/i686-linux/enc/trans/emoji_sjis_kddi.so
/home/vagrant/.rvm/rubies/ruby-1.9.3-p194/lib/ruby/1.9.1/i686-linux/enc/encdb.so
/home/vagrant/.rvm/rubies/ruby-1.9.3-p194/lib/ruby/1.9.1/i686-linux/enc/utf_16le.so
/home/vagrant/.rvm/rubies/ruby-1.9.3-p194/lib/ruby/1.9.1/i686-linux/enc/gbk.so
/home/vagrant/.rvm/rubies/ruby-1.9.3-p194/lib/ruby/1.9.1/i686-linux/enc/iso_8859_8.so
/home/vagrant/.rvm/rubies/ruby-1.9.3-p194/lib/ruby/1.9.1/i686-linux/enc/euc_tw.so
/home/vagrant/.rvm/rubies/ruby-1.9.3-p194/lib/ruby/1.9.1/i686-linux/enc/koi8_r.so
/home/vagrant/.rvm/rubies/ruby-1.9.3-p194/lib/ruby/1.9.1/i686-linux/enc/iso_8859_9.so
/home/vagrant/.rvm/rubies/ruby-1.9.3-p194/lib/ruby/1.9.1/i686-linux/enc/utf_32le.so
/home/vagrant/.rvm/rubies/ruby-1.9.3-p194/lib/ruby/1.9.1/i686-linux/enc/big5.so
/home/vagrant/.rvm/rubies/ruby-1.9.3-p194/lib/ruby/1.9.1/i686-linux/enc/shift_jis.so
/home/vagrant/.rvm/rubies/ruby-1.9.3-p194/lib/ruby/1.9.1/i686-linux/enc/cp949.so
/home/vagrant/.rvm/rubies/ruby-1.9.3-p194/lib/ruby/1.9.1/i686-linux/enc/gb18030.so
/home/vagrant/.rvm/rubies/ruby-1.9.3-p194/lib/ruby/1.9.1/i686-linux/enc/koi8_u.so
/home/vagrant/.rvm/rubies/ruby-1.9.3-p194/lib/ruby/1.9.1/i686-linux/enc/iso_8859_7.so
/home/vagrant/.rvm/rubies/ruby-1.9.3-p194/lib/ruby/1.9.1/i686-linux/enc/utf_32be.so
/home/vagrant/.rvm/rubies/ruby-1.9.3-p194/lib/ruby/1.9.1/i686-linux/enc/euc_kr.so
/home/vagrant/.rvm/rubies/ruby-1.9.3-p194/lib/ruby/1.9.1/i686-linux/enc/iso_8859_15.so
/home/vagrant/.rvm/rubies/ruby-1.9.3-p194/lib/ruby/1.9.1/i686-linux/enc/iso_8859_10.so
/home/vagrant/.rvm/rubies/ruby-1.9.3-p194/lib/ruby/1.9.1/i686-linux/enc/iso_8859_3.so
/home/vagrant/.rvm/rubies/ruby-1.9.3-p194/lib/ruby/1.9.1/i686-linux/enc/utf_16be.so
/home/vagrant/.rvm/rubies/ruby-1.9.3-p194/lib/ruby/1.9.1/i686-linux/enc/emacs_mule.so
/home/vagrant/.rvm/rubies/ruby-1.9.3-p194/lib/ruby/1.9.1/i686-linux/enc/iso_8859_2.so
/home/vagrant/.rvm/rubies/ruby-1.9.3-p194/lib/ruby/1.9.1/i686-linux/enc/iso_8859_6.so
/home/vagrant/.rvm/rubies/ruby-1.9.3-p194/lib/ruby/1.9.1/i686-linux/enc/iso_8859_13.so
/home/vagrant/.rvm/rubies/ruby-1.9.3-p194/lib/ruby/1.9.1/i686-linux/enc/iso_8859_5.so
/home/vagrant/.rvm/rubies/ruby-1.9.3-p194/lib/ruby/1.9.1/i686-linux/enc/iso_8859_11.so
/home/vagrant/.rvm/rubies/ruby-1.9.3-p194/lib/ruby/1.9.1/i686-linux/json
/home/vagrant/.rvm/rubies/ruby-1.9.3-p194/lib/ruby/1.9.1/i686-linux/json/ext
/home/vagrant/.rvm/rubies/ruby-1.9.3-p194/lib/ruby/1.9.1/i686-linux/json/ext/generator.so
/home/vagrant/.rvm/rubies/ruby-1.9.3-p194/lib/ruby/1.9.1/i686-linux/json/ext/parser.so
/home/vagrant/.rvm/rubies/ruby-1.9.3-p194/lib/ruby/1.9.1/i686-linux/curses.so
/home/vagrant/.rvm/rubies/ruby-1.9.3-p194/lib/ruby/1.9.1/i686-linux/fiber.so
/home/vagrant/.rvm/rubies/ruby-1.9.3-p194/lib/ruby/1.9.1/i686-linux/racc
/home/vagrant/.rvm/rubies/ruby-1.9.3-p194/lib/ruby/1.9.1/i686-linux/racc/cparse.so
/home/vagrant/.rvm/rubies/ruby-1.9.3-p194/lib/ruby/1.9.1/i686-linux/stringio.so
/home/vagrant/.rvm/rubies/ruby-1.9.3-p194/lib/ruby/1.9.1/i686-linux/bigdecimal.so
/home/vagrant/.rvm/rubies/ruby-1.9.3-p194/lib/ruby/1.9.1/i686-linux/syslog.so
/home/vagrant/.rvm/rubies/ruby-1.9.3-p194/lib/ruby/1.9.1/i686-linux/psych.so
/home/vagrant/.rvm/rubies/ruby-1.9.3-p194/lib/ruby/1.9.1/i686-linux/rbconfig.rb
/home/vagrant/.rvm/rubies/ruby-1.9.3-p194/lib/ruby/1.9.1/i686-linux/gdbm.so
/home/vagrant/.rvm/rubies/ruby-1.9.3-p194/lib/ruby/1.9.1/i686-linux/date_core.so
/home/vagrant/.rvm/rubies/ruby-1.9.3-p194/lib/ruby/1.9.1/i686-linux/pathname.so
/home/vagrant/.rvm/rubies/ruby-1.9.3-p194/lib/ruby/1.9.1/i686-linux/etc.so
/home/vagrant/.rvm/rubies/ruby-1.9.3-p194/lib/ruby/1.9.1/i686-linux/digest.so
/home/vagrant/.rvm/rubies/ruby-1.9.3-p194/lib/ruby/1.9.1/i686-linux/dl
/home/vagrant/.rvm/rubies/ruby-1.9.3-p194/lib/ruby/1.9.1/i686-linux/dl/callback.so
/home/vagrant/.rvm/rubies/ruby-1.9.3-p194/lib/ruby/1.9.1/i686-linux/openssl.so
/home/vagrant/.rvm/rubies/ruby-1.9.3-p194/lib/ruby/1.9.1/i686-linux/digest
/home/vagrant/.rvm/rubies/ruby-1.9.3-p194/lib/ruby/1.9.1/i686-linux/digest/md5.so
/home/vagrant/.rvm/rubies/ruby-1.9.3-p194/lib/ruby/1.9.1/i686-linux/digest/rmd160.so
/home/vagrant/.rvm/rubies/ruby-1.9.3-p194/lib/ruby/1.9.1/i686-linux/digest/sha2.so
/home/vagrant/.rvm/rubies/ruby-1.9.3-p194/lib/ruby/1.9.1/i686-linux/digest/sha1.so
/home/vagrant/.rvm/rubies/ruby-1.9.3-p194/lib/ruby/1.9.1/i686-linux/digest/bubblebabble.so
/home/vagrant/.rvm/rubies/ruby-1.9.3-p194/lib/ruby/1.9.1/i686-linux/sdbm.so
/home/vagrant/.rvm/rubies/ruby-1.9.3-p194/lib/ruby/1.9.1/i686-linux/mathn
/home/vagrant/.rvm/rubies/ruby-1.9.3-p194/lib/ruby/1.9.1/i686-linux/mathn/rational.so
/home/vagrant/.rvm/rubies/ruby-1.9.3-p194/lib/ruby/1.9.1/i686-linux/mathn/complex.so
/home/vagrant/.rvm/rubies/ruby-1.9.3-p194/lib/ruby/1.9.1/i686-linux/continuation.so
/home/vagrant/.rvm/rubies/ruby-1.9.3-p194/lib/ruby/1.9.1/i686-linux/fcntl.so
/home/vagrant/.rvm/rubies/ruby-1.9.3-p194/lib/ruby/1.9.1/i686-linux/objspace.so
/home/vagrant/.rvm/rubies/ruby-1.9.3-p194/lib/ruby/1.9.1/i686-linux/readline.so
/home/vagrant/.rvm/rubies/ruby-1.9.3-p194/lib/ruby/1.9.1/i686-linux/ripper.so
/home/vagrant/.rvm/rubies/ruby-1.9.3-p194/lib/ruby/1.9.1/i686-linux/nkf.so
/home/vagrant/.rvm/rubies/ruby-1.9.3-p194/lib/ruby/1.9.1/i686-linux/fiddle.so
/home/vagrant/.rvm/rubies/ruby-1.9.3-p194/lib/ruby/1.9.1/i686-linux/coverage.so

我怎样才能安装缺少的标题( ruby.h和朋友)?

Answer 1:

要检查在错误的位置,以检查:

$ find /home/mpapis/.rvm/rubies/ruby-1.9.3-p194/ -name ruby.h
/home/mpapis/.rvm/rubies/ruby-1.9.3-p194/include/ruby-1.9.1/ruby/ruby.h
/home/mpapis/.rvm/rubies/ruby-1.9.3-p194/include/ruby-1.9.1/ruby.h


Answer 2:

还有就是你可以传递一个选项rvm install ,这将迫使rvm从源代码编译红宝石实例:

rvm install <ruby-version> --disable-binary

这使得我能够成功安装fog与它的依赖性nokogiri

我碰到的这个解决方案GitHub上线 ; 它被张贴mpapis那里。



文章来源: Install ruby headers with rvm