5

starling gem を Windows マシンにインストールしようとしています。しかし、インストールしようとするたびに、次のエラーが発生します。

Building native extensions.  This could take a while...  
ERROR:  Error installing starling:  
        ERROR: Failed to build gem native extension.  

c:/ruby/bin/ruby.exe extconf.rb install starling -- --srcdir= c:\ruby-1.8.7-p72  
checking for windows.h... no  
*** 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/bin/ruby  

Gem files will remain installed in c:/ruby/lib/ruby/gems/1.8/gems/eventmachine-0
.12.2 for inspection.  
Results logged to c:/ruby/lib/ruby/gems/1.8/gems/eventmachine-0.12.2/ext/gem_mak
e.out

windows.hヘッダーを提供するには何をインストールする必要がありますか?

4

4 に答える 4

6

Gemsは現在、Windows で多少壊れています。当時は Windows で壊れていましたが、現在は修正されています。次の回避策は、Ruby の古いワンクリック インストーラー バージョンに適用されます。新しい MinGW ベースのRubyInstallerDevKitに更新する必要があります。回避策は引き続き機能しますが、将来的にはより保証されます。

  • win32 バイナリを含む問題の gem (この場合はeventmachine ) のバージョンを見つけます。RubyForgeを見ると、win32 バイナリを所有する最後の eventmachine gem がバージョン 0.12.0 であることがわかります。
  • そのバージョンのイベント マシンを強制的にインストールします。

    $ gem install eventmachine --version=0.12.0
    Successfully installed eventmachine-0.12.0-x86-mswin32
    1 gem installed
    Installing ri documentation for eventmachine-0.12.0-x86-mswin32...
    Installing RDoc documentation for eventmachine-0.12.0-x86-mswin32...

  • ここで、元の gem をもう一度インストールしてみてください。

    $ gem install starling
    Successfully installed ZenTest-3.10.0
    Successfully installed memcache-client-1.5.0
    Successfully installed SyslogLogger-1.4.0
    Successfully installed starling-0.9.8
    4 gems installed
    Installing ri documentation for ZenTest-3.10.0...
    Installing ri documentation for memcache-client-1.5.0...
    Installing ri documentation for SyslogLogger-1.4.0...
    Installing ri documentation for starling-0.9.8...
    Installing RDoc documentation for ZenTest-3.10.0...
    Installing RDoc documentation for memcache-client-1.5.0...
    Installing RDoc documentation for SyslogLogger-1.4.0...
    Installing RDoc documentation for starling-0.9.8...

ただし、gems を実行gem updateすると愚かにも最新バージョンの eventmachine をインストールしようとすることに注意してください。これにより、gem の更新が完全に停止します。この特定の問題を回避する方法については、この質問を参照してください。

于 2008-10-03T14:50:09.247 に答える
0

これが機能するかどうかはわかりませんが、C コンパイラが付属する Windows での Ruby のワンクリック インストーラに取り組んでいる人がいます。

http://github.com/luislavena/rubyinstaller/tree/masterを参照してください

于 2008-10-03T12:14:33.180 に答える
0

すべてがインストールされたので、ウィンドウの下で動作させることは可能ですか? Windows には fork() プロセスがないため、このマシンでは実装されていない fork() 関数を取得しています。

于 2008-12-13T06:41:57.837 に答える
0

eventmachine gem のインストールでスタックしているようです。ここで最も簡単な方法は、ここから Windows 用の eventmachine バイナリ gem をダウンロードしてインストールすることです。

それ以外の場合は、コンパイラが必要になります。(私はあなたが持っていないと仮定します)

于 2008-10-03T04:48:00.930 に答える