edge rails(3.2.0.beta)に上げてみた

戯れに手元のrailsをmasterを見るようにしてみたらサーバが起動しなくなりました。

hamlのエラー

#gem 'rails', '3.0.9'
# Bundle edge Rails instead:
gem 'rails', :git => 'git://github.com/rails/rails.git'
$ bundle exec rails s
=> Booting WEBrick
=> Rails 3.2.0.beta application starting in development on http://0.0.0.0:3000
=> Call with -d to detach
=> Ctrl-C to shutdown server
Exiting
/Users/y_310/work/sample_prj/vendor/bundle/ruby/1.9.1/gems/haml-3.1.2/lib/haml/template/patch.rb:16:in `alias_method': undefined method `delegate_template_exists?' for class `ActionView::Base' (NameError)

エラーをぐぐってみるとどうやらhamlのバグっぽい。
https://github.com/nex3/haml/issues/395
そしてこの問題はここですでに修正済。
https://github.com/nex3/haml/pull/398

ただ普通にgem installして入るバージョンは3.1.0でギリギリこの修正コミットは入っていないみたい。

仕方ないのでhamlもedgeを見るようにする。

gem 'haml', :git => 'git://github.com/nex3/haml.git'

rjsのエラー

hamlを最新にして再度サーバを起動しようとするとまたエラーが出ました。

=> Booting WEBrick
=> Rails 3.2.0.beta application starting in development on http://0.0.0.0:3000
=> Call with -d to detach
=> Ctrl-C to shutdown server
Exiting
/Users/y_310/work/sample_prj/vendor/bundle/ruby/1.9.1/bundler/gems/rails-3b5eb11664b8/actionpack/lib/action_view/railtie.rb:34:in `block (3 levels) in <class:Railtie>': undefined method `debug_rjs=' for ActionView::Base:Class (NoMethodError)

これもググッてみるとこのページがヒットしました。
http://weblog.rubyonrails.org/2011/4/21/jquery-new-default

rails3.1で標準のJSライブラリがprototype.jsからjQueryになった際に、rjsもデフォルトで入らなくなったらしい。
rjsは必要ないので書いてあるとおりにconfig/environments/development.rbから以下の行を削除

# remove next line
config.action_view.debug_rjs = true

これで無事にサーバが起動しました。