(続)Windows7(x64)でWebsocketを試してみる

devkitを入れてみる

そうだ、devkitを入れないといけないんだ。
そういえば最近、そんな話を先輩としたようなしてないような・・・

ということでdevkitをインストール

http://rubyinstaller.org/downloads/

ダウンロードしてインストールして
初期化して

C:\ruby-1.9.2-p0-x64\bin>ruby dk.rb init

Initialization complete! Please review and modify the auto-generated
'config.yml' file to ensure it contains the root directories to all
of the installed Rubies you want enhanced by the DevKit.

C:\Ruby19\Devkit>

config.ymlを修正して、レビューして

C:\ruby-1.9.2-p0-x64\devkit>ruby dk.rb review
Based upon the settings in the 'config.yml' file generated
from running 'ruby dk.rb init' and any of your customizations,
DevKit functionality will be injected into the following Rubies
when you run 'ruby dk.rb install'.

C:/ruby-1.9.2-p0-x64

※dk.rbがあるところで実行

で、devkitをインストール

C:\ruby-1.9.2-p0-x64\devkitt>ruby dk.rb install
[INFO] Installing 'C:\ruby-1.9.2-p0-x64/lib/ruby/site_ruby/1.9.1/rubygems/defaults/operating_system.rb'
[INFO] Installing 'C:\ruby-1.9.2-p0-x64/lib/ruby/site_ruby/devkit.rb'

よし、OK。

今度こそ完璧。
うりゃぁ。

C:\ruby-1.9.2-p0-x64\devkit>gem install rev-websocket
Temporarily enhancing PATH to include DevKit...
Building native extensions.  This could take a while...
ERROR:  Error installing rev-websocket:
        ERROR: Failed to build gem native extension.

        C:/ruby-1.9.2-p0-x64/bin/ruby.exe extconf.rb
checking for main() in c.lib... *** extconf.rb failed ***
Could not create Makefile due to some reason, probably lack of
necessary libraries and/or headers.  Check the mkmf.log file for more
details.  You may need configuration options.

Provided configuration options:
        --with-opt-dir
        --without-opt-dir
        --with-opt-include
        --without-opt-include=${opt-dir}/include
        --with-opt-lib
        --without-opt-lib=${opt-dir}/lib
        --with-make-prog
        --srcdir=.
        --curdir
        --ruby=C:/ruby-1.9.2-p0-x64/bin/ruby
        --with-iobuffer-dir
        --without-iobuffer-dir
        --with-iobuffer-include
        --without-iobuffer-include=${iobuffer-dir}/include
        --with-iobuffer-lib
        --without-iobuffer-lib=${iobuffer-dir}/lib
        --with-clib
        --without-clib
C:/ruby-1.9.2-p0-x64/lib/ruby/1.9.1/mkmf.rb:368:in `try_do': The complier failed
 to generate an executable file. (RuntimeError)
You have to install development tools first.
        from C:/ruby-1.9.2-p0-x64/lib/ruby/1.9.1/mkmf.rb:435:in `try_link0'
        from C:/ruby-1.9.2-p0-x64/lib/ruby/1.9.1/mkmf.rb:440:in `try_link'
        from C:/ruby-1.9.2-p0-x64/lib/ruby/1.9.1/mkmf.rb:552:in `try_func'
        from C:/ruby-1.9.2-p0-x64/lib/ruby/1.9.1/mkmf.rb:748:in `block in have_l
ibrary'
        from C:/ruby-1.9.2-p0-x64/lib/ruby/1.9.1/mkmf.rb:693:in `block in checki
ng_for'
        from C:/ruby-1.9.2-p0-x64/lib/ruby/1.9.1/mkmf.rb:280:in `block (2 levels
) in postpone'
        from C:/ruby-1.9.2-p0-x64/lib/ruby/1.9.1/mkmf.rb:254:in `open'
        from C:/ruby-1.9.2-p0-x64/lib/ruby/1.9.1/mkmf.rb:280:in `block in postpo
ne'
        from C:/ruby-1.9.2-p0-x64/lib/ruby/1.9.1/mkmf.rb:254:in `open'
        from C:/ruby-1.9.2-p0-x64/lib/ruby/1.9.1/mkmf.rb:276:in `postpone'
        from C:/ruby-1.9.2-p0-x64/lib/ruby/1.9.1/mkmf.rb:692:in `checking_for'
        from C:/ruby-1.9.2-p0-x64/lib/ruby/1.9.1/mkmf.rb:743:in `have_library'
        from extconf.rb:4:in `
' Gem files will remain installed in C:/ruby-1.9.2-p0-x64/lib/ruby/gems/1.9.1/gems /iobuffer-1.0.0 for inspection. Results logged to C:/ruby-1.9.2-p0-x64/lib/ruby/gems/1.9.1/gems/iobuffer-1.0.0/e xt/gem_make.out C:\ruby-1.9.2-p0-x64\devkit>

orz

でも、

Temporarily enhancing PATH to include DevKit...
Building native extensions.  This could take a while...

って書いてあるのでちょっと状況は改善した・・・ように見える。


WinXP&32bitで試してみる

もうらちがあかないので、とりあえず別のマシンで試してみる。

    • rubyのインストール
    • zlibのインストール
    • devkitのインストール

で、

C:\Ruby192\devkit>gem install rev-websocket --platform mswin32
Fetching: eventmachine-0.12.10-x86-mswin32-60.gem (100%)
Fetching: daemons-1.1.4.gem (100%)
Fetching: thin-1.2.11-x86-mswin32.gem (100%)
Fetching: rev-websocket-0.1.3.gem (100%)
Successfully installed eventmachine-0.12.10-x86-mswin32-60
Successfully installed daemons-1.1.4
Successfully installed thin-1.2.11-x86-mswin32
Successfully installed rev-websocket-0.1.3
4 gems installed
Installing ri documentation for eventmachine-0.12.10-x86-mswin32-60...
Installing ri documentation for daemons-1.1.4...
Installing ri documentation for thin-1.2.11-x86-mswin32...
Installing ri documentation for rev-websocket-0.1.3...
Installing RDoc documentation for eventmachine-0.12.10-x86-mswin32-60...
Installing RDoc documentation for daemons-1.1.4...
Installing RDoc documentation for thin-1.2.11-x86-mswin32...
Installing RDoc documentation for rev-websocket-0.1.3...

おおおおおおおぉぉぉぉぉぉ
成功!!!

・・・でもこれ求めているのとは違うマシンorz

64bitになぜ入らない。

荒技で試してみる

頭にきたので、winxp&32bitでインストールしてできたgemの下のrev-websocketのフォルダをコピーして
64bitマシンにコピーしてやった。

require 'rev/websocket';

とだけ書いたrubyのファイルを実行してみる。

C:\ruby-1.9.2-p0-x64>ruby test.rb
:29:in `require': no such file to load --
rev/websocket (LoadError)
        from :29:in `require'
        from test.rb:1:in `
'

ですよね・・・

解決の糸口が見つからない