railsをwindowsでうごかく

初期セットアップは、こちらを参考に実行。
「railsinstaller」(ver.2.1.0)を使うと、windowsでも楽にセットアップができた。
http://thinkit.co.jp/story/2012/06/21/3594

ただし、Railsのサーバーを立ち上げるときに以下のエラーがでるので、下の手順で解決が必要。
「Could not find gem ‘jquery-rails (>= 0) x86-mingw32′ in any of the gem sources listed in your Gemfile.
Run `bundle install` to install missing gems.」

これは、gem で jquery を インストールする必要があるということらしい。

gem install jquery

(参考)
http://www.edita.jp/trpg-m/archive/category17-5.html
http://www.akiyama.co/pc-blog/entry/entry22.php

※他にもいくつかインストールが必要なのでエラーメッセージの内容を見て、それぞれ「gem install xxxx」を実行。


「Could not find eventmachine-0.12.10 in any of the sources」がやっかいだった。

手順はだいたい以下のサイトを参考に実行
http://d.hatena.ne.jp/kusakari/20100830/1283147872

ただし、すでにインストールされているパッケージは入れる必要がないので
gem list
でインストール済みパッケージを確認しながら実行したほうがいい。

「git clone https://github.com/eventmachine/eventmachine.git」の
くだりは、urlの後ろに/(スラッシュ)をつけるかどうにかして対応

「rake package」のくだりはエラーになるかもしれない。

「c:\RailsInstaller\Ruby1.9.3\lib\ruby\gems\1.9.1\gems\eventmachine-0.12.10」の下にpkgフォルダが存在して、
「eventmachine-0.12.10.gem」が存在すればOK。
参考にしたサイトでは「eventmachine-0.12.11.gem」となっていたのでバージョンは確認して実行したほうがよさそう。


「c:\Sites\fb\guarded-hollows-1343>bundle exec rails server
C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/bundler-1.0.22/lib/bundler/rubygems_integration.rb:143:in `block in replace_gem': railties is not part of the bundle. Add it to Gemfile. (Gem::LoadError)
from C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/bin/rails:18:in `

'」
こんなエラーがでた。railsファイルを開いて、18行目を確認。
「gem 'railties', version」
とあったので、railtiesがないのかなと思って、
「gem install railties
でinstall。それでも直らないので、
Gemfileに以下を追加
「gem "railties"」
これで一応エラーが解消された。