Ruby で SQLite
秋晴れの良い天気のある日のこと
調べた感じでは、こんな手順。
楽勝のはずだった
d> gem install sqlite3 ERROR: Could not find a valid gem 'sqlite3' (>= 0), here is why: Unable to download data from https://rubygems.org/ - SSL_connect returned=1 errno=0 state=SSLv3 read server certificate B: certificate verify failed (https://rubygems.org/latest_specs.4.8.gz)
エラーメッセージでググる、という基本
ふたつ目に引っかかったのがこれ。
Workaround RubyGems' SSL errors on Ruby for Windows (RubyInstaller) · GitHub
RubyGems をアップデートしろということらしい。
使ってるのは 2.0.0 系なので、こちらをインストール。
Release 2.0.15 Released · rubygems/rubygems · GitHub
やってみる
d> gem --version 2.0.14 d> gem install --local rubygems-update-2.0.15.gem Successfully installed rubygems-update-2.0.15 Parsing documentation for rubygems-update-2.0.15 Installing ri documentation for rubygems-update-2.0.15 1 gem installed d> update_rubygems --no-ri --no-rdoc RubyGems 2.0.15 installed === 2.0.14 / 2013-11-12 Bug fixes: * Restore concurrent requires following the fix for ruby bug #8374. Pull request #637 and issue #640 by Charles Nutter. * Gem::Specification::remove_spec no longer checks for existence of the spec to be removed. Issue #698 by Tiago Macedo. * Restored wildcard handling when installing gems. Issue #697 by Chuck Remes. * Added DigiCert High Assurance EV Root CA certificate for the cloudfront.net certificate change. * The Gem::RemoteFetcher tests now choose the test server port more reliably. Pull Request #706 by akr. ------------------------------------------------------------------------------ RubyGems installed the following executables: c:/usr/ruby-2.0.0/bin/gem d> gem --version 2.0.15 d> gem uninstall rubygems-update -x Removing update_rubygems Successfully uninstalled rubygems-update-2.0.15 d> gem --version 2.0.15
やっぱり天気が良いと、気分も良い
気を取り直して、sqlite3 をインストールだ。
d> gem install sqlite3 Fetching: sqlite3-1.3.10-x86-mingw32.gem (100%) Successfully installed sqlite3-1.3.10-x86-mingw32 Parsing documentation for sqlite3-1.3.10-x86-mingw32 unable to convert "\x90" from ASCII-8BIT to UTF-8 for lib/sqlite3/1.8/sqlite3_native.so, skipping unable to convert "\x90" from ASCII-8BIT to UTF-8 for lib/sqlite3/1.9/sqlite3_native.so, skipping unable to convert "\x90" from ASCII-8BIT to UTF-8 for lib/sqlite3/2.0/sqlite3_native.so, skipping unable to convert "\x90" from ASCII-8BIT to UTF-8 for lib/sqlite3/2.1/sqlite3_native.so, skipping Installing ri documentation for sqlite3-1.3.10-x86-mingw32 1 gem installed
めでたし、めでたし。
しつこさは美徳
後で、こんなのも見つけた。
http://qiita.com/giiko_/items/493f6ffc3547fbc35667
http://ria10.hatenablog.com/entry/20130527/1369647304
証明書が古いから gem でインストールができない。
gem を 2.0.3 に上げれば良いのだけれど、gem が使えないからアップデートもできない、という鶏が先か卵が先かみたいな問題になってる、ということらしい。
Even if we have official releases of any of the versions that correct the issue, it will not be possible install those via RubyGems (chicken-egg problem described before).
https://gist.github.com/luislavena/f064211759ee0f806c88:tltle
SSL が使えなければ、素の http を使えば良いじゃない。
d> gem source -a http://rubygems.org d> gem install rubygems-update d> gem install *** d> gem source -r http://rubygems.org
-a は --add 、-r は --remove とも。