Skip to content

Instantly share code, notes, and snippets.

@tcnksm
Created March 6, 2014 12:41
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tcnksm/9388736 to your computer and use it in GitHub Desktop.
Save tcnksm/9388736 to your computer and use it in GitHub Desktop.
FROM centos
# Install basic packages
RUN rpm -Uvh http://download.fedoraproject.org/pub/epel/6/i386/epel-release-6-8.noarch.rpm
RUN yum -y update
RUN yum install -y make gcc gcc-c++ wget curl git
RUN yum install -y openssl-devel zlib-devel readline-devel libffi-devel httpd-devel libyaml-devel
RUN yum install -y bzip2 autoconf automake libtool bison iconv-devel ruby-devel
RUN yum --enablerepo=epel -y install libyaml-devel
# Install rbenv and ruby-build
RUN git clone https://github.com/sstephenson/rbenv.git /root/.rbenv
RUN git clone https://github.com/sstephenson/ruby-build.git /root/.rbenv/plugins/ruby-build
RUN ./root/.rbenv/plugins/ruby-build/install.sh
ENV PATH /root/.rbenv/bin:$PATH
RUN echo 'eval "$(rbenv init -)"' >> /etc/profile.d/rbenv.sh # or /etc/profile
RUN echo 'eval "$(rbenv init -)"' >> .bashrc
# Install multiple versions of ruby
ENV CONFIGURE_OPTS --disable-install-doc
RUN rbenv install 2.0.0-p353
RUN rbenv install 1.9.3-p484
# Install Bundler for each version of ruby
RUN echo 'gem: --no-rdoc --no-ri' >> /.gemrc
RUN bash -l -c 'rbenv global 2.0.0-p353; gem update; gem install bundler'
RUN bash -l -c 'rbenv global 1.9.3-p484; gem update; gem install bundler'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment