Skip to content

Instantly share code, notes, and snippets.

@masamitsu-konya
Created June 10, 2014 05:48
Show Gist options
  • Save masamitsu-konya/640d869c9f488b136dfd to your computer and use it in GitHub Desktop.
Save masamitsu-konya/640d869c9f488b136dfd to your computer and use it in GitHub Desktop.
新しいMBP買ったので、おさらい的にローカルでのRails環境構築手順まとめ ref: http://qiita.com/masamitsu-konya/items/c99127a58f0cf2c5dfaf
export PATH="$HOME/.rbenv/bin:$PATH"
eval "$(rbenv init -)"
ruby -e "$(curl -fsSL https://raw.github.com/mxcl/homebrew/go/install)"
sudo git clone git://github.com/sstephenson/rbenv.git ~/.rbenv
sudo mkdir -p ~/.rbenv/plugins
sudo git clone https://github.com/sstephenson/ruby-build.git ~/.rbenv/plugins/ruby-build
ruby -v
ruby 2.1.2p95 (2014-05-08 revision 45877) [x86_64-darwin13.0]
sudo rbenv exec gem install bundler
sudo rbenv rehash
cat << EOS > Gemfile
source "http://rubygems.org"
gem "rails", "4.1.1" # ←ローカルインストールしたいRailsのバージョンを指定。指定しなければ最新版が入る。
EOS
bundle install --path vendor/bundle
bundle exec rails new example --skip-bundle
rm -f Gemfile
rm -f Gemfile.lock
rm -fr .bundle
rm -fr vendor/bundle
cd example
bundle install --path vendor/bundle
bundle exec rails s
.bundle
db/*.sqlite3*
log/*.log
*.log
tmp/**/*
tmp/*
*.swp
*~
.DS_Store
vendor/*
vi .bash_profile
git add .
git commit -am "first commit"
git remote add origin git@github.com:username/example.git
git pull origin master
git push origin master
sudo rbenv exec gem list
sudo rbenv exec gem which bundler
cd test_project
bundle list
source ~/.bash_profile
brew install openssl
brew install readline
rbenv install -l
sudo rbenv install 2.1.2
sudo rbenv rehash
sudo rbenv global 2.1.2
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment