OpenSSLのアップデートによりRubyのSSL接続でエラーが出る件

環境
Mac OS X 10.7
・rvm 1.16.6
ruby 1.9.3

OpenSSL 1.x環境だと、以下のようなエラーが出るらしい

/Users/katoken/.rvm/rubies/ruby-1.9.3-p194/lib/ruby/1.9.1/net/http.rb:799:in `connect': Connection reset by peer - SSL_connect (Errno::ECONNRESET)
from /Users/katoken/.rvm/rubies/ruby-1.9.3-p194/lib/ruby/1.9.1/net/http.rb:799:in `block in connect'
from /Users/katoken/.rvm/rubies/ruby-1.9.3-p194/lib/ruby/1.9.1/timeout.rb:54:in `timeout'
from /Users/katoken/.rvm/rubies/ruby-1.9.3-p194/lib/ruby/1.9.1/timeout.rb:99:in `timeout'
from /Users/katoken/.rvm/rubies/ruby-1.9.3-p194/lib/ruby/1.9.1/net/http.rb:799:in `connect'
from /Users/katoken/.rvm/rubies/ruby-1.9.3-p194/lib/ruby/1.9.1/net/http.rb:755:in `do_start'
from /Users/katoken/.rvm/rubies/ruby-1.9.3-p194/lib/ruby/1.9.1/net/http.rb:744:in `start'

こうすると良いと書いてあったが、
相変わらずエラーのままだった。

$ rvm pkg install openssl
$ rvm reinstall 1.9.3 --with-openssl-dir=~/.rvm/usr

最終的には、以下のようにして無事接続することができた。

http = Net::HTTP.new(uri.host, uri.port)
http.use_ssl = true
http.verify_mode = OpenSSL::SSL::VERIFY_PEER
http.ssl_version = :SSLv3 #ここ

【Rails】スケルトン作成時にsqlite3(1.3.5)がインストールできずにエラーが出る件

環境:CentOS 5.7
Railsを始めようとした矢先、さっそくエラーで詰んでしまった

Installing sqlite3 (1.3.5) with native extensions
Gem::Installer::ExtensionBuildError: ERROR: Failed to build gem native extension.

        /usr/local/bin/ruby extconf.rb 
checking for sqlite3.h... yes
checking for sqlite3_libversion_number() in -lsqlite3... yes
checking for rb_proc_arity()... yes
checking for sqlite3_initialize()... no
checking for sqlite3_backup_init()... no
checking for sqlite3_column_database_name()... no
checking for sqlite3_enable_load_extension()... no
checking for sqlite3_load_extension()... no
creating Makefile

make
compiling database.c
database.c: In function ‘initialize’:
database.c:47: error: ‘SQLITE_OPEN_READWRITE’ undeclared (first use in this function)
database.c:47: error: (Each undeclared identifier is reported only once
database.c:47: error: for each function it appears in.)
database.c:47: error: ‘SQLITE_OPEN_CREATE’ undeclared (first use in this function)
database.c:79: error: ‘SQLITE_OPEN_READONLY’ undeclared (first use in this function)
database.c:81: 警告: implicit declaration of function ‘sqlite3_open_v2’
database.c: In function ‘set_sqlite3_func_result’:
database.c:285: error: ‘sqlite3_int64’ undeclared (first use in this function)
database.c:285: error: expected expression before ‘long’
database.c: In function ‘collation’:
database.c:628: 警告: implicit declaration of function ‘sqlite3_create_collation_v2’
database.c: In function ‘load_extension’:
database.c:657: 警告: implicit declaration of function ‘sqlite3_load_extension’
database.c: In function ‘enable_load_extension’:
database.c:678: 警告: implicit declaration of function ‘sqlite3_enable_load_extension’
make: *** [database.o] エラー 1


Gem files will remain installed in /home/katoken/.bundler/tmp/11543/gems/sqlite3-1.3.5 for inspection.
Results logged to /home/katoken/.bundler/tmp/11543/gems/sqlite3-1.3.5/ext/sqlite3/gem_make.out
An error occured while installing sqlite3 (1.3.5), and Bundler cannot continue.
Make sure that `gem install sqlite3 -v '1.3.5'` succeeds before bundling.

このようなエラーが出て、スケルトンが作成できなかった

http://www.sdmemo.com/wiki/Ruby_on_Rails%E3%83%A1%E3%83%A2
このサイトに

CentOS5.4標準のsqlite3(3.3.6)を、2011/08/08時点の最新バージョンである3.7.7.1に置き換えたら正常にインストールできました。

とあったので、sqlite3をソースコードからインストールすることで解決した。

# wget http://www.sqlite.org/sqlite-autoconf-3071100.tar.gz
# tar xvf sqlite-autoconf-3071100.tar.gz
# cd sqlite-autoconf-3071100
# ./configure
# make && make install