Setup Ruby with Ubuntu
setup Ruby on Ubuntu 12.04 LTS with rbenv - I installed Ubuntu to my old laptop (Windows 7) with - wubi. And I did
open terminal = ctrl + alt + T
(and then connect to Wi-Fi )
install git
$ sudo apt-get update
$ sudo apt-get install git
https://github.com/sstephenson/rbenv#installation
https://github.com/sstephenson/ruby-build#readme
follow direction and install rbenv + ruby-build
$ git clone https://github.com/sstephenson/rbenv.git ~/.rbenv
$ echo 'export PATH="$HOME/.rbenv/bin:$PATH"' >> ~/.bashrc
$ echo 'eval "$(rbenv init -)"' >> ~/.bashrc
$ exec $SHELL
$ type rbenv
"rbenv is a function"
$ git clone https://github.com/sstephenson/ruby-build.git ~/.rbenv/plugins/ruby-build
install ruby - stable versions
- Ruby 1.9.3-p545
- Ruby 2.0.0-p451
- Ruby 2.1.1
$ rbenv install 1.9.3-p545
$ rbenv install 2.0.0-p451
$ rbenv install 2.1.1
$ rbenv versions
$ rbenv global 2.0.0-p451
$ rbenv version
$ ruby -v
$ rbenv rehash
However it said “The Ruby openssl extension was not compiled. Missing the OpenSSL lib?” So I did
( found it by search ) this first and install Ruby.
$ sudo apt-get -y install build-essential zlib1g-dev libreadline-dev libssl-dev libcurl4-openssl-dev libsqlite3-dev
$ rbenv install 2.0.0-p451
And then…
Rails install was successful to me on 2.0.0.
install sqlite3
$ gem install sqlite3
bundler
$ gem install bundler
http://rubyonrails.org/download/
rails
$ gem install rails --no-ri --no-rdoc
( forget --no-ri --no-rdoc
part, and wait extra long time )
$ rails new testapp
$ cd testapp
$ rails server
http://localhost:3000/
Tried to open on localhost. This time it said “Could not find a JavaScript runtime” So I did
https://github.com/joyent/node/wiki/Installing-Node.js-via-package-manager#ubuntu-mint-elementary-os
install node.js
$ sudo apt-get install nodejs
$ node -v
v0.10.26
$ exec $SHELL
$ rails -v
Rails 4.1.0
$ rails server
http://localhost:3000/
Ruby on Rails!
Additionally,
text editor sublime_text
$ cd ~
$ wget http://c758482.r82.cf2.rackcdn.com/Sublime\ Text\ 2.0.2.tar.bz2
$ tar vxjf Sublime\ Text\ 2.0.2.tar.bz2
(it depends by its version)
$ sudo mv Sublime\ Text\ 2 /opt/Sublime\ Text\ 2
$ sudo ln -s /opt/Sublime\ Text\ 2/sublime_text /usr/bin/subl
$ subl &