Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Install ruby headers with rvm

Travis CI uses RVM to provide Ruby, but it doen't seem to contain the headers:

$ 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

How can I install the missing headers (ruby.h and friends)?

like image 404
raphink Avatar asked Jul 20 '12 08:07

raphink


2 Answers

There is an option that you can pass to rvm install which will force rvm to compile the ruby instance from source:

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

This made it possible for me to successfully install fog and its dependency nokogiri.

I came across this solution in a GitHub thread; it was posted by mpapis there.

like image 157
chb Avatar answered Sep 29 '22 10:09

chb


you are checking in wrong location, check with:

$ 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
like image 31
mpapis Avatar answered Sep 29 '22 10:09

mpapis