Sunday, December 1, 2013

How to install Ruby with Rbenv and tools in Ubuntu 13.10 / Mint 16

Install some basics
$ sudo apt-get install zlib1g zlib1g-dev build-essential sqlite3 libsqlite3-dev openssl libssl-dev curl git libmagick++-dev

Use git to install rbenv and the ruby-build plugin
$ git clone ~/.rbenv
$ git clone git:// .rbenv/plugins/ruby-build

$ echo 'export PATH="$HOME/.rbenv/bin:$PATH"' >> ~/.bash_profile
$ echo 'eval "$(rbenv init -)"' >> ~/.bash_profile

$ echo 'export PATH="$HOME/.rbenv/bin:$PATH"' >> ~/.bashrc
$ echo 'eval "$(rbenv init -)"' >> ~/.bashrc

Close and reopen terminal
$ type rbenv
Should return rbenv is a function at the prompt

List Ruby versions known to rbenv
$ rbenv install -l

Install the version you require and set it as global
rbenv install 2.0.0-p353
rbenv rehash
rbenv global 2.0.0-p353

Add ssh key
ssh-agent /bin/bash
ssh-add ~/.ssh/id_rsa
cat ~/.ssh/
Copy & paste result as a new ssh key to your Github / Bitbucket account

Add git global config
git config --global push.default simple
git config --global "name surname"
git config --global
git config --global color.ui auto

gem install bundler
Restart terminal to use bundle command within a project folder

Pre-load environment for fast rails commands
gem install zeus
Restart terminal to use zeus commands
  • zeus start
  • zeus test xxx
  • zeus s
  • zeus rake

No comments:

Post a Comment