Skip to content

Instantly share code, notes, and snippets.

@bahamas10
Created March 9, 2015 15:25
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save bahamas10/6a052faa8644d3d462d5 to your computer and use it in GitHub Desktop.
Save bahamas10/6a052faa8644d3d462d5 to your computer and use it in GitHub Desktop.
install isolated ruby and chef on smartos
(as root)
mkdir ~/src
cd ~/src
# install ruby
wget http://cache.ruby-lang.org/pub/ruby/2.2/ruby-2.2.1.tar.gz
tar xf ruby-2.2.1.tar.gz
cd ruby-2.2.1
./configure --prefix=/opt/chef --with-opt-dir=/opt/local --enable-shared ac_cv_func_dl_iterate_phdr=no CFLAGS="-R -fPIC" rb_cv_have_signbit=no --disable-install-doc
make -j 8
mkdir /opt/chef
make install
# install chef
/opt/chef/bin/gem install --no-ri --no-rdoc chef -v 12.1.0
# FAIL! now we fix ffi
cd ~/src
curl -o ffi.patch https://github.com/ffi/ffi/pull/399.diff
/opt/chef/bin/gem install gem-patch
/opt/chef/bin/gem patch /opt/chef/lib/ruby/gems/2.2.0/cache/ffi-1.9.6.gem ./ffi.patch -p 1
# retry chef install, this time it should work
/opt/chef/bin/gem install --no-ri --no-rdoc chef -v 12.1.0
# done, /opt/chef/bin has every executable needed by chef
@bahamas10
Copy link
Author

for raspberry pi

(as root)

# deps
apt-get install -y openssl libreadline6-dev git-core zlib1g libssl-dev
apt-get install -y libyaml-dev libsqlite3-dev sqlite3
apt-get install -y libxml2-dev libxslt-dev
apt-get install -y autoconf automake libtool bison

mkdir ~/src
cd ~/src

# install ruby
wget http://cache.ruby-lang.org/pub/ruby/2.2/ruby-2.2.1.tar.gz
tar xf ruby-2.2.1.tar.gz
cd ruby-2.2.1
./configure --prefix=/opt/chef --disable-install-doc
make -j 4
mkdir /opt/chef
make install

# install chef
/opt/chef/bin/gem install --no-ri --no-rdoc chef -v 12.1.1

# done, /opt/chef/bin has every executable needed by chef

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