Mar
17th
2010
Wed
17th
2010
Something great about installing ruby from source
I discovered something cool today - if you build ruby from source, you have the option to install additional components after the fact, pretty easily and independently. For example, I’ve often lamented that some of the builds I’ve done didn’t install readline support, and I didn’t really realize how to add that. As it turns out, it’s pretty trivial. In your source directory, there will be an /ext folder, e.g.:
install/ruby-1.9.1-p376/ext/Inside that directory, there are lots of other folders. Install the readline libraries (this will be readline from source, or the readline-dev or readline-devel package depending on your platform), and then do:
ruby extconf.rb make && make installThat’s it! If they didn’t get installed properly when you first built from source, this works the same way with all of the common extensions you probably want - openssl, zlib, iconv, etc…