Skip to content

Instantly share code, notes, and snippets.

@bixu
Last active December 15, 2015 20:09
Show Gist options
  • Save bixu/5316445 to your computer and use it in GitHub Desktop.
Save bixu/5316445 to your computer and use it in GitHub Desktop.
build ruby-2.0.0-p0 on smartos / illumos, including commonly-used libs/headers, etc - tested on smartos_bas64_1.9.1
## curl the raw version of this gist like this:
## curl -s -L https://gist.github.com/bixu/5316445/raw/[revision]/ruby-2.0.0-p0+on+smartos | bash
pkgin -y install build-essential libyaml readline libxml2 libxslt postgresql92-client
git clone git://github.com/sstephenson/rbenv.git ~/.rbenv
git clone git://github.com/sstephenson/ruby-build.git ~/.rbenv/plugins/ruby-build
echo 'export PATH="$HOME/.rbenv/bin:$PATH"' >> ~/.bash_profile
echo 'eval "$(rbenv init -)"' >> ~/.bash_profile
exec $SHELL -l
wget -N http://ftp.ruby-lang.org/pub/ruby/2.0/ruby-2.0.0-p0.tar.gz
tar -xvf ruby-2.0.0-p0.tar.gz
cd ruby-2.0.0-p0
mkdir -p $HOME/.rbenv/versions/2.0.0-p0
bash ./configure 'CFLAGS=-m64 -std=gnu99' 'CXXFLAGS=-m64' 'LDFLAGS=-m64' --prefix=$HOME/.rbenv/versions/2.0.0-p0 --enable-shared --disable-install-doc --disable-install-capi --with-opt-dir=/opt/local
make
make install
rbenv global 2.0.0-p0
rbenv rehash
## speshial shit for sqlite3 and ImageMagick:
gem install sqlite3-ruby -- --with-sqlite3-include=/opt/local/include --with-sqlite3-lib=/opt/local/lib
pkgin -y install ImageMagick pkg-config
@bixu
Copy link
Author

bixu commented Apr 18, 2013

Thanks, André.

@wanelo-pair
Copy link

Also, CFLAGS like -O3 may need to be set manually, even on the latest rbenv: rbenv/ruby-build#352

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment