My MBA 2011 Mid 11inch came back

What I have to is

1. Xcode with X11
2. JDK
3. Homebrew insted of MacPorts
4. git
5. RVM
6. Ruby
7. RubyGems
8. Rails
9. SQlite3

$ ruby -v
ruby 1.8.7 (2010-01-10 patchlevel 249) [universal-darwin11.0]

$ gem -v
1.3.6

$ rails -v
not installed

Xcode with X11

Search Xcode on AppStore, download and install.

JDK

When we put javac, then automatically installer starts.

$ javac -version
javac 1.6.0_29

Homebrew

$ ruby -e "$(curl -fsSL https://raw.github.com/gist/323731)"
$ brew help

Git

$ brew install git
$ brew update
$ brew -v
0.8.1

http://tukaikta.blog135.fc2.com/blog-entry-201.html

RVM

$ bash -s stable < <(curl -s https://raw.github.com/wayneeseguin/rvm/master/binscripts/rvm-installer)
$ echo ' -s "$HOME/.rvm/scripts/rvm"  && . "$HOME/.rvm/scripts/rvm" # Load RVM function' >> ~/.bash_profile
$ source ~/.bash_profile

Ruby

$ rvm install 1.9.2
The provided compiler '/usr/bin/gcc' is LLVM based, it is not yet fully supported by ruby and gems, please read `rvm requirements`.

$ brew install https://raw.github.com/adamv/homebrew-alt/master/duplicates/apple-gcc42.rb
$ gcc-4.2 -v
$ rvm install 1.9.2 --with-gcc=gcc-4.2
$ rvm list

Add below to ~/.bash_profile

export CC=gcc-4.2
$ source ~/.bach_profile
$ rvm install 1.9.3-p0
$ ruby -v
ruby 1.8.7
$ rvm use 1.9.2
$ ruby -v
ruby 1.9.2p290

Update RubyGems

$ sudo gem update --system
$ sudo gem update rake

Rails

Currently, No Rails.

$ gem list --local rails
$ rails --version
$ gem install rails --version 3.1.0

SQLite3

$ sqlite3 -version
3.7.7

Do rails

$ mkdir ~/work
$ cd ~/work
$ rails new demo
$ cd demo
$ rake about
About your application's environment
Ruby version              1.9.2 (x86_64-darwin11.3.0)
RubyGems version          1.8.17
Rack version              1.3
Rails version             3.1.0
JavaScript Runtime        JavaScriptCore
Active Record version     3.1.0
Action Pack version       3.1.0
Active Resource version   3.1.0
Action Mailer version     3.1.0
Active Support version    3.1.0
Middleware                ActionDispatch::Static, Rack::Lock, #, Rack::Runtime, Rack::MethodOverride, Rails::Rack::Logger, ActionDispatch::ShowExceptions, ActionDispatch::RemoteIp, Rack::Sendfile, ActionDispatch::Reloader, ActionDispatch::Callbacks, ActiveRecord::ConnectionAdapters::ConnectionManagement, ActiveRecord::QueryCache, ActionDispatch::Cookies, ActionDispatch::Session::CookieStore, ActionDispatch::Flash, ActionDispatch::ParamsParser, ActionDispatch::Head, Rack::ConditionalGet, Rack::ETag, ActionDispatch::BestStandardsSupport
Application root          /Users/xxx/work/demo
Environment               development
Database adapter          sqlite3
Database schema version   0

$ rails server
=> Booting WEBrick

"bundle install" is done automatically.

Go to http://localhost:3000
Rails framework itself worked. Actually no application on "demo".

$ Create simple application

$ rails generate scaffold Product title:string description:text image_url:string price:decimal
$ rake db:migrate
$ rails server

Go to http://localhost:3000/products

http://codenote.net/mac/752.html