Code Review Stack Exchange is a question and answer site for peer programmer code reviews. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I want to write an automated bash script for installing ruby and rails using rbenv. But I am getting issue of session reload in terminal.

My bash script:-

#!/bin/bash
echo "Installing rbenv.."
git clone https://github.com/rbenv/rbenv.git ~/.rbenv
git clone https://github.com/rbenv/ruby-build.git ~/.rbenv/plugins/ruby-build
echo 'export PATH="$HOME/.rbenv/bin:$PATH"' >> ~/.bashrc
echo 'eval "$(rbenv init -)"' >> ~/.bashrc
source ~/.bashrc
reset
echo "Finished installing rbenv"

#!/bin/bash
rbenv -v
echo "Installing ruby.."
sudo rbenv install 2.2.3
rbenv global 2.2.3
echo "Finished installing ruby"
ruby -v

echo "gem: --no-document" > ~/.gemrc

echo "Installing rails.."
sudo apt-get install ruby-dev
sudo gem install bundler
gem install rails -v 4.2.3
rbenv rehash
echo "Finished installing rails"
rails -v
rbenv rehash
share|improve this question

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.