Rails 4.1.8でExecJS::ProgramErrorが発生する

随分前に会社の人からもらった本「たのしい開発 スタートアップRuby」を読んで、今更だがRuby on Railsを試して見た。
RailsのインストールにはRailsInstallerを使用した。
現時点のRailsのバージョンは4.1.8で、本に記載の3.2.1よりも随分と新しい。
Railsと合わせてインストールされるRubyのバージョンは2.1.5だった。
動作環境はWindows 7 Home Premiumである。
本に記載の手順で以下のコマンドを実行すると、さっそくエラーが発生した。

> rails new hoge_app
    :
    :
         run  bundle install
    :
    :
Gem::RemoteFetcher::FetchError: SSL_connect returned=1 errno=0 state=SSLv3 read
server certificate B: certificate verify failed (https://rubygems.org/gems/threa
d_safe-0.3.5.gem)
An error occurred while installing thread_safe (0.3.5), and Bundler cannot
continue.
Make sure that `gem install thread_safe -v '0.3.5'` succeeds before bundling.

上記メッセージの指示通りに「gem install」を実行しても、次々と同様のエラーが発生する。

> gem install thread_safe -v '0.3.5'
> cd hoge_app
> bundle install
    :
    :
Gem::RemoteFetcher::FetchError: SSL_connect returned=1 errno=0 state=SSLv3 read
server certificate B: certificate verify failed (https://rubygems.org/gems/execj
s-2.4.0.gem)
An error occurred while installing execjs (2.4.0), and Bundler cannot continue.
Make sure that `gem install execjs -v '2.4.0'` succeeds before bundling.

これを解決するために、hoge_appフォルダ以下のGemfileの先頭行を変更した。

source 'https://rubygems.org'
    ↓
source 'http://rubygems.org'

上記修正で「bundle install」は成功したので、次のステップに進んだ。

> rails g scaffold book title:string memo:text
> rake db:migrate
> rails s

WEBrickによるWEBサーバが起動するので、WEBブラウザで以下のURLにアクセスするとエラーが発生した。

URL
http://localhost:3000/books
エラー
ExecJS::ProgramError in Books#index

コントローラでcoffeeスクリプトがエラーになったようだ。
幸い同様の事例が見つかったので、そのページに記載の方法で解決することができた。

参考
http://qiita.com/scivola/items/ec7625118fcf6de5203a
解決策
以下のようにGemFileでcoffee-script-sourceのバージョンを指定する行を追加。
次に「bundle update coffee-script-source」を実行。
gem 'coffee-rails', '~> 4.0.0'
    ↓
gem 'coffee-rails', '~> 4.0.0'
gem 'coffee-script-source', '1.8.0'

これで正常に動作した。