Ruby on Rails3.2.6をWindows環境にgemでインストールする時に若干ハマったのでメモ
概要:
rails installをして
指定のフォルダでrails new hogehogeして
rails serverしようとするとgemさんに
「アレがないコレがない」と言われてWEBrickが起動しない。
bundle installしようとするとbundle installがそもそも失敗する。
それを解消する為のメモ。
1.gem install railsで以下のメッセージが出る
Please update your PATH to include build tools or download the DevKit from 'http://rubyinstaller.org/downloads’ and follow the instructions at 'http://github.com/oneclick/rubyinstaller/wiki/Development-Kit’
対策:
1.http://rubyinstaller.org/downloads/からDEVELOPMENT KITをDL
2.マルチバイト文字を含まないフォルダ名のフォルダに解凍。
Rubyを実行する際に読みに行くフォルダになるため、
めんどくさがって「新しいフォルダ」とかに解凍してはいけない。
絶対絶対いけない。
*1
3.解凍したフォルダにcd
4.以下のコマンドを実行
ruby dk.rb init ruby dk.rb review ruby dk.rb install
2.bundle installでこける
Gem::RemoteFetcher::FetchError: SSL_connect returned=1 errno=0 state=SSLv3 read server certificate B: certificate verify failed (https://rubygems.org/gems/coff e-rails-3.2.2.gem) An error occured while installing coffee-rails (3.2.2), and Bundler cannot cont nue. Make sure that `gem install coffee-rails -v '3.2.2'` succeeds before bundling.
対策:
1.以下のコマンドを実行。DL先がhttpsだとDLに失敗するバグが修正される。
gem update --system
ここまでやってようやくrails serverが動いた。やれやれ