setup Rails ubuntu 14.04 LTS

what I tried

ubuntu 14.04 LTS install / and update
—after that
open terminal ctl+alt T
install git - at ubuntu software center

(need git to install rbenv)

$ git --version
git version 1.9.1

install rbenv

$ 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"

https://github.com/sstephenson/rbenv#installation
https://github.com/sstephenson/ruby-build#readme

$ git clone https://github.com/sstephenson/ruby-build.git ~/.rbenv/plugins/ruby-build
$ rbenv install -list

install three of ruby versions

$ rbenv install 1.9.3-p547
$ rbenv install 2.0.0-p481
$ rbenv install 2.1.2

rbenv install 2.0.0-p451 didn’t work so tried

$ rbenv global 1.9.3-p545
$ ruby -v
ruby 1.9.3p545

and then tried again

$ rbenv install 2.0.0-p451

didn’t work so read error message “…The Ruby openssl extension was not compiled. Missing the OpenSSL lib?” a-ha!

so I tried this (I forgot about this..)

$ sudo apt-get -y install build-essential zlib1g-dev libreadline-dev libssl-dev libcurl4-openssl-dev libsqlite3-dev 

+

git-core sqlite3 curl libyaml-dev libxml2-dev libxslt1-dev python-software-properties

(I didn’t do this but gorails.com says do)
and then tried again

$ rbenv install 2.0.0-p451

didn’t work. this time simply exit and open terminal and then try. didn’t work. go home and let’s try again.

did I update?

$ sudo apt-get update

and try again didn’t work. install 2.1.2 first and worked!

$ rbenv install 2.1.2

and then.. found out there’s stable version 2.0.0-p481. so tried

$ rbenv global 2.1.2
$ rbenv install 2.0.0-p481

and it worked!

$ rbenv uninstall 1.9.3-p545
$ rbenv install 1.9.3-p547

not it seems all done in installing ruby versions. Now I installed gems.

$ gem install sqlite3
$ gem install bundler
$ sudo apt-get install nodejs
$ nodejs -v
v0.10.25

(need node.js to do “rails server”)

$ gem install rails --no-ri --no-rdoc
$ rbenv rehash
$ rails new testapp
$ cd testapp
$ rails server

(and lookup localhost:3000 in the browser)

download sublime text from ‘sublimetext.com’ and extract on home, and set the shortcut.

$ sudo mv 'Sublime Text 2' /opt/Sublime\ Text\ 2
$ sudo ln -s '/opt/Sublime Text 2/sublime_text' /usr/bin/subl
$ subl .

I think it worked. just going to open another terminal window after opening.

 
3
Kudos
 
3
Kudos

Now read this

exercism.io with Guard-Shell

I’m enjoying exercism.io like anybody else. Inspired by Ruby Koans with guard shell I set it up for my practicing. Please comment at my gist for any further suggestions. In the ~/exercism/ruby directory, add two files Guardfile and... Continue →