Assets.github.com%2fimages%2fgravatars%2fgravatar-140

Install Ruby 2.0.0 Preview 1 + Rails 4.0.0 beta /w OS X (Using Rbenv and Homebrew) Edit

  • Assets.github.com%2fimages%2fgravatars%2fgravatar-140 ne_ko_ posted in (Edited )
  • GenTamura84
  • wayana_nonta
  • kjunichi
  • dfang@github
  • shu_0115
  • ogawaso
  • sue738
  • tachiba@github
  • tqctlps@github
  • ruedap
  • kitaindia
  • thso83
  • 5ostbusters@github
  • 9m
Edit

適宜飛ばすべし。

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
Icon-ok
5 users said this post was useful/correct.

Version Information


Sign up and follow ne_ko_ :)

Sign up with GitHub/Twitter

x close