Skip to content

Instantly share code, notes, and snippets.

@Koroeskohr
Created November 5, 2016 17:14
Show Gist options
  • Save Koroeskohr/3c685f243928226f47c43080007c7e09 to your computer and use it in GitHub Desktop.
Save Koroeskohr/3c685f243928226f47c43080007c7e09 to your computer and use it in GitHub Desktop.
Install Ruby with ZSH
cd
git clone git://github.com/sstephenson/rbenv.git .rbenv
echo 'export PATH="$HOME/.rbenv/bin:$PATH"' >> ~/.zshrc
echo 'eval "$(rbenv init -)"' >> ~/.zshrc
git clone git://github.com/sstephenson/ruby-build.git ~/.rbenv/plugins/ruby-build
echo 'export PATH="$HOME/.rbenv/plugins/ruby-build/bin:$PATH"' >> ~/.zshrc
source ~/.zshrc
sudo apt-get install -y libssl-dev libreadline-dev zlib1g-dev
rbenv install -v 2.3.1
rbenv global 2.3.1
ruby -v
echo "gem: --no-document" > ~/.gemrc
gem install bundler
rbenv rehash
@escalopa
Copy link

I had already ruby installed i just wanted to add it to ZSH
SO I just added these 2 lines from the commands above to my ZSH file

export PATH="$HOME/.rbenv/bin:$PATH"
eval "$(rbenv init -)"

Now I can run ruby or rails on my ZSH

to check if ruby & rails are working run

ruby --version
rails --version

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