`rescue in create_default_data_source' なるエラー

windows8(64bit)に、RubyOnRails をインストールしてみた。
はじめてのRubyで、諸々はまったのでメモ。(64bitだと色々あるらしい。)

環境
・windows8.1(64bit)
・Rails 4.1.6
・ruby 2.1.3p242 (2014-09-19 revision 47630) [x64-mingw32]


・作業
下記のURLを参考にインストールを進めてみた
http://www.oiax.jp/rails/zakkan/rails_3_1_installation_on_windows.html


1.まずハマったこと
・下記のようにSQLite3 がロードできない。とかいうエラー

 /lib/sqlite3.rb:6:in `require': cannot load such file -- sqlite3/sqlite3_native (LoadError)


・やったこと
 /Ruby21-x64/lib/ruby/gems/2.1.0/specifications/sqlite3-1.3.9-x64-mingw32.gemspec

 「Sublime Text 3」というエディタをインストールし、上記ファイルを開き

  s.require_paths=["lib"] 

   の記述箇所を

  s.require_paths= ["lib/sqlite3_native"]

   に変更

  ※ちなみにソースはここ


2. 次にハマったこと
・下記のようにデータソースが無い。とかいうエラー

/lib/tzinfo/data_source.rb:182:in `rescue in create_default_data_source': No source of timezone data could be found. (TZInfo::DataSourceNotFound)

Please refer to http://tzinfo.github.io/datasourcenotfound for help resolving this error.


・やったこと
何やらググると下記の様な記述が散見されるのですが、
初心者には、んで、この「Gemfile」ってのは、どこにあるのかしら?という
疑問しか残りませんでした。(初心者過ぎて申し訳なし)

Gemfileに以下のような記述があるので、64bit向けに修正します。
64bit版のRubyはplatformsが x64_mingw になるので、これを追加してやれば良い。つまりこうする

んで、

プロジェクトルートにある「gemfile」を同じく「Sublime Text 3」というエディタで開き
下記のように修正。

変更前
# Windows does not include zoneinfo files, so bundle the tzinfo-data gem
gem 'tzinfo-data', platforms: [:mingw, :mswin]


変更後
# Windows does not include zoneinfo files, so bundle the tzinfo-data gem
# gem 'tzinfo-data', platforms: [:mingw, :mswin]
gem 'tzinfo-data', platforms: [:mingw, :mswin, :x64_mingw]

色々、試したが最終的に「ruby2.1.x」ではその他のエラーが解消されない。ということが分かった。
また、「ruby2.0.x」では動作するということが分かったので再インストールした。

※「ruby2.0.x」で再インストールしたら、上記の一切のエラーは発生しなかった。。。

コメント