Perlユーザがruby on railsに挑む - インストール編
先程のポストと前後してしまうが、rails入れました。 コンセプトはrubyからperlに来たものが多いけど、最初にperlで開発しているので色々困惑してしまう。まず押さえておくところは、
- perlbrew — rbenv
- cpanm — gem
- carton — bundler
- Mojolicious等のWAF - ralis
というところなんだと思う。コンセプトを知ってるのでI can understand very very smoothly :D
rbenvを入れる
OSXユーザなので
$ brew update
$ brew install openssl
$ brew install readline
$ brew install rbenv
$ brew install ruby-build
$ echo 'eval "$(rbenv init -)"' >> ~/.bash_profile
rbenvでruby2.0.0-p0を入れる
$ rbenv install -l # make sure 2.0.0-p0 is available
$ RUBY_CONFIGURE_OPTS="--with-readline-dir=`brew --prefix readline` --with-openssl-dir=`brew --prefix openssl`" rbenv install 2.0.0-p0
$ rbenv global 2.0.0-p0
$ rbenv rehash
$ ruby —version
rbenvでbundlerを入れる
$ rbenv exec gem install bundler
project毎にbundle install including rails :)
ref : http://qiita.com/items/a60886152a4c99ce1017
$ cd ~/dev
$ cat > Gemfile
source "http://rubygems.org"
gem "rails", "3.2.11"
# ctl^c
$ bundle install --path vendor/bundle
$ bundle exec rails new a_proj --skip-bundle
$rm -f Gemfile
$rm -f Gemfile.lock
$rm -rf .bundle
$rm -rf vendor/bundle
$cd a_proj
$ vi Gemfile # add yours
$bundle install --path vendor/bundle
$ echo '/vendor/bundle' >> .gitignore
# git push
# use always bundle exe to run the commands
$ bundle exec rails s # start server