Last active
March 29, 2017 09:59
-
-
Save vik-y/7008cabf5cd1a104a761049b203d7b33 to your computer and use it in GitHub Desktop.
A script to install rails using rbenv on fedora (Cross platform work in progress)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Install all prerequisites | |
os=$(awk -F= '/^NAME/{print $2}' /etc/os-release) | |
yum install git-core zlib zlib-devel gcc-c++ patch readline readline-devel libyaml-devel libffi-devel openssl-devel make bzip2 autoconf automake libtool bison curl sqlite-devel | |
cd | |
git clone git://github.com/sstephenson/rbenv.git .rbenv | |
echo 'export PATH="$HOME/.rbenv/bin:$PATH"' >> ~/.bash_profile | |
echo 'eval "$(rbenv init -)"' >> ~/.bash_profile | |
exec $SHELL | |
git clone git://github.com/sstephenson/ruby-build.git ~/.rbenv/plugins/ruby-build | |
echo 'export PATH="$HOME/.rbenv/plugins/ruby-build/bin:$PATH"' >> ~/.bashrc | |
exec $SHELL | |
git clone https://github.com/sstephenson/rbenv-gem-rehash.git ~/.rbenv/plugins/rbenv-gem-rehash | |
source ~/.bashrc | |
# Install the ruby version which you want | |
rbenv install 2.3.1 | |
rbenv global 2.3.1 | |
gem install rails -v 4.2.1 --no-ri --no-rdoc | |
#modify this to take versions in cmd argument | |
# This should be get enough to get rails up and running in fedora | |
# TODO: | |
# Make this a generic script to run on both debian as well as rpm based systems. | |
# Make it fail safe. If some step fails in the middle then add capability to resume | |
# from the failed step instead of starting from beginning. | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment