適宜飛ばすべし。
Install Rbenv
$ brew install rbenv
$ brew install ruby-build
$ echo 'export PATH="$HOME/.rbenv/bin:$PATH"' >> ~/.zshenv
$ echo 'eval "$(rbenv init -)"' >> ~/.zshenv
Install OpenSSL
$ brew install openssl
$ brew link openssl
Install Readline
$ brew install readline
$ brew link readline
Install Ruby 2.0.0 Preview 1
$ CONFIGURE_OPTS="--with-readline-dir=/usr/local --with-openssl-dir=/usr/local" rbenv install 2.0.0-preview1
$ rbenv global 2.0.0-preview1
Install Bundler
$ gem install bundler
$ rbenv rehash
Create Gemfile for Rails 4
$ cd ~/path/to/your/workspace/rails4
$ vim Gemfile
Ruby
source :rubygems
%w[rails activerecord-deprecated_finders journey].each do |name|
gem name, github: "rails/#{name}"
end
$ bundle install --path .bundle
Setup new Rails 4 App
$ bundle exec rails new ~/code/rails/four --skip-bundle
$ cd ~/code/rails/four
$ vim Gemfile
Ruby
source 'https://rubygems.org'
def rails_edge_gems(gems)
gems.each do |name|
gem "#{name}", github: "rails/#{name}"
end
end
rails_edge_gems %w[rails activerecord-deprecated_finders journey]
gem 'sqlite3'
group :assets do
rails_edge_gems %i[sprockets-rails sass-rails coffee-rails]
gem 'uglifier', '>= 1.0.3'
end
gem 'jquery-rails'
gem 'turbolinks'
gem 'unicorn'
$ bundle install --path .bundle
$ bundle exec unicorn_rails -p 8080 -D
$ open http://localhost:8080








