65

Windows に Thin Gem をインストールできません。ネイティブ拡張機能のビルド中に何かが起こります。

誰も同じ問題に直面していますか?

スタック トレースは次のとおりです。

>gem install thin --no-ri --no-rdoc
Temporarily enhancing PATH to include DevKit...
Building native extensions.  This could take a while...
ERROR:  Error installing thin:
        ERROR: Failed to build gem native extension.

C:/Ruby/bin/ruby.exe extconf.rb
checking for rb_trap_immediate in ruby.h,rubysig.h... no
checking for rb_thread_blocking_region()... yes
checking for inotify_init() in sys/inotify.h... no
checking for __NR_inotify_init in sys/syscall.h... no
checking for writev() in sys/uio.h... no
checking for rb_thread_check_ints()... yes
checking for rb_time_new()... yes
checking for windows.h... yes
checking for winsock.h... yes
checking for main() in -lkernel32... yes
checking for main() in -lrpcrt4... yes
checking for main() in -lgdi32... yes
checking for main() in -lssl... no
creating Makefile

make
g++ -I. -IC:/Ruby/include/ruby-1.9.1/i386-mingw32 -I/C/Ruby/include/ruby-1.9.1/ruby/backward -I/C/Ru
by/include/ruby-1.9.1 -I. -DBUILD_FOR_RUBY -DHAVE_RB_THREAD_BLOCKING_REGION -DHAVE_TBR -DHAVE_RB_THR
EAD_CHECK_INTS -DHAVE_RB_TIME_NEW -DOS_WIN32 -DHAVE_WINDOWS_H -DHAVE_WINSOCK_H -DWITHOUT_SSL -DHAVE_
MAKE_PAIR    -O3 -g -Wextra -Wno-unused-parameter -Wno-parentheses -Wpointer-arith -Wwrite-strings -
Wno-missing-field-initializers -Wno-long-long   -o binder.o -c binder.cpp
In file included from project.h:137:0,
                 from binder.cpp:20:
binder.h:35:34: warning: type qualifiers ignored on function return type
In file included from project.h:138:0,
                 from binder.cpp:20:
em.h:91:47: warning: type qualifiers ignored on function return type
em.h:92:76: warning: type qualifiers ignored on function return type
em.h:93:56: warning: type qualifiers ignored on function return type
em.h:95:57: warning: type qualifiers ignored on function return type
em.h:96:60: warning: type qualifiers ignored on function return type
em.h:97:58: warning: type qualifiers ignored on function return type
em.h:98:55: warning: type qualifiers ignored on function return type
em.h:99:36: warning: type qualifiers ignored on function return type
em.h:101:47: warning: type qualifiers ignored on function return type
em.h:106:42: warning: type qualifiers ignored on function return type
em.h:123:45: warning: type qualifiers ignored on function return type
em.h:132:36: warning: type qualifiers ignored on function return type
In file included from project.h:145:0,
                 from binder.cpp:20:
eventmachine.h:45:61: warning: type qualifiers ignored on function return type
eventmachine.h:46:112: warning: type qualifiers ignored on function return type
eventmachine.h:47:69: warning: type qualifiers ignored on function return type
eventmachine.h:49:73: warning: type qualifiers ignored on function return type
eventmachine.h:62:75: warning: type qualifiers ignored on function return type
eventmachine.h:63:74: warning: type qualifiers ignored on function return type
eventmachine.h:64:77: warning: type qualifiers ignored on function return type
eventmachine.h:65:41: warning: type qualifiers ignored on function return type
In file included from project.h:145:0,
                 from binder.cpp:20:
eventmachine.h:99:60: warning: type qualifiers ignored on function return type
eventmachine.h:100:58: warning: type qualifiers ignored on function return type
eventmachine.h:102:60: warning: type qualifiers ignored on function return type
eventmachine.h:105:41: warning: type qualifiers ignored on function return type
g++ -I. -IC:/Ruby/include/ruby-1.9.1/i386-mingw32 -I/C/Ruby/include/ruby-1.9.1/ruby/backward -I/C/Ru
by/include/ruby-1.9.1 -I. -DBUILD_FOR_RUBY -DHAVE_RB_THREAD_BLOCKING_REGION -DHAVE_TBR -DHAVE_RB_THR
EAD_CHECK_INTS -DHAVE_RB_TIME_NEW -DOS_WIN32 -DHAVE_WINDOWS_H -DHAVE_WINSOCK_H -DWITHOUT_SSL -DHAVE_
MAKE_PAIR    -O3 -g -Wextra -Wno-unused-parameter -Wno-parentheses -Wpointer-arith -Wwrite-strings -
Wno-missing-field-initializers -Wno-long-long   -o cmain.o -c cmain.cpp
In file included from project.h:137:0,
                 from cmain.cpp:20:
binder.h:35:34: warning: type qualifiers ignored on function return type
In file included from project.h:138:0,
                 from cmain.cpp:20:
em.h:91:47: warning: type qualifiers ignored on function return type
em.h:92:76: warning: type qualifiers ignored on function return type
em.h:93:56: warning: type qualifiers ignored on function return type
em.h:95:57: warning: type qualifiers ignored on function return type
em.h:96:60: warning: type qualifiers ignored on function return type
em.h:97:58: warning: type qualifiers ignored on function return type
em.h:98:55: warning: type qualifiers ignored on function return type
em.h:99:36: warning: type qualifiers ignored on function return type
em.h:101:47: warning: type qualifiers ignored on function return type
em.h:106:42: warning: type qualifiers ignored on function return type
em.h:123:45: warning: type qualifiers ignored on function return type
em.h:132:36: warning: type qualifiers ignored on function return type
In file included from project.h:145:0,
                 from cmain.cpp:20:
eventmachine.h:45:61: warning: type qualifiers ignored on function return type
eventmachine.h:46:112: warning: type qualifiers ignored on function return type
eventmachine.h:47:69: warning: type qualifiers ignored on function return type
eventmachine.h:49:73: warning: type qualifiers ignored on function return type
eventmachine.h:62:75: warning: type qualifiers ignored on function return type
eventmachine.h:63:74: warning: type qualifiers ignored on function return type
eventmachine.h:64:77: warning: type qualifiers ignored on function return type
eventmachine.h:65:41: warning: type qualifiers ignored on function return type
In file included from project.h:145:0,
                 from cmain.cpp:20:
eventmachine.h:99:60: warning: type qualifiers ignored on function return type
eventmachine.h:100:58: warning: type qualifiers ignored on function return type
eventmachine.h:102:60: warning: type qualifiers ignored on function return type
eventmachine.h:105:41: warning: type qualifiers ignored on function return type
cmain.cpp:98:71: warning: type qualifiers ignored on function return type
cmain.cpp:109:122: warning: type qualifiers ignored on function return type
cmain.cpp:119:79: warning: type qualifiers ignored on function return type
cmain.cpp:129:83: warning: type qualifiers ignored on function return type
cmain.cpp:260:85: warning: type qualifiers ignored on function return type
cmain.cpp:270:84: warning: type qualifiers ignored on function return type
cmain.cpp:280:88: warning: type qualifiers ignored on function return type
cmain.cpp:290:51: warning: type qualifiers ignored on function return type
cmain.cpp:300:70: warning: type qualifiers ignored on function return type
cmain.cpp:320:55: warning: type qualifiers ignored on function return type
cmain.cpp:546:70: warning: type qualifiers ignored on function return type
cmain.cpp:669:68: warning: type qualifiers ignored on function return type
cmain.cpp: In function 'int evma_send_file_data_to_connection(long unsigned int, const char*)':
cmain.cpp:752:6: error: cannot convert 'stat*' to '_stati64*' for argument '2' to 'int _fstati64(int
, _stati64*)'
make: *** [cmain.o] Error 1


Gem files will remain installed in C:/Ruby/lib/ruby/gems/1.9.1/gems/eventmachine-0.12.10 for inspect
ion.
Results logged to C:/Ruby/lib/ruby/gems/1.9.1/gems/eventmachine-0.12.10/ext/gem_make.out
4

6 に答える 6

110

git または ruby​​gems リポジトリからのインストールは、(現在) 1.9.2 または 1.9.3 では機能しません (2012 年 6 月 22 日にまだ壊れていることが確認されています)。代わりに、次のことを行う必要があります。

gem install eventmachine --pre
gem install thin

2012 年 6 月 18 日に現在のプレリリースの名前が に変更された1.0.0.rc.1ため、Windows で動作するバージョンが「間もなく」正式リリースになり、これはもはや問題でなくなる可能性があることに注意してください。


github リポジトリから 1.9.2 で gem をビルドしようとすると、次のように表示されることがあります (検索エンジンのヒットに含まれています)。

C:\eventmachine> rake ビルド
(C:/eventmachine 内)
CD内線
C:/Ruby/bin/ruby.exe extconf.rb
ruby.h、rubysig.h の rb_trap_immediate をチェックしています... *** extconf.rb に失敗しました ***
何らかの理由で Makefile を作成できませんでした。必要なファイルが不足している可能性があります
ライブラリおよび/またはヘッダー。詳細については、mkmf.log ファイルを確認してください。

rubygems リポジトリから 1.9.3 の下に gem をインストールしようとすると、次のように表示されることがあります (検索エンジンのヒットに含まれています)。

C:\>gem インストール イベントマシン
DevKit を含めるために PATH を一時的に強化しています...
ネイティブ拡張機能の構築。これにはしばらく時間がかかる場合があります...
エラー: eventmachine のインストール中にエラーが発生しました:
        エラー: gem ネイティブ拡張のビルドに失敗しました。

        C:/Ruby193/bin/ruby.exe extconf.rb
ruby.h、rubysig.h で rb_trap_immediate をチェックしています...いいえ
rb_thread_blocking_region() をチェックしています...はい
sys/inotify.h で inotify_init() をチェックしています... いいえ
sys/syscall.h で __NR_inotify_init をチェックしています... いいえ
sys/uio.h で writev() をチェックしています... いいえ
rb_thread_check_ints() をチェックしています...はい
rb_time_new() をチェックしています...はい
windows.hをチェックしています...はい
winsock.h をチェックしています...はい
-lkernel32 で main() をチェックしています...はい
-lrpcrt4 で main() をチェックしています...はい
-lgdi32 で main() をチェックしています...はい
-lssl で main() をチェックしています... いいえ
Makefile の作成

作る
rubyeventmachine-i386-mingw32.def の生成
コンパイルするbinder.cpp
cc1plus.exe: 警告: コマンド ライン オプション "-Wdeclaration-after-statement" は C/ObjC では有効ですが、C++ では有効ではありません
cc1plus.exe: 警告: コマンド ライン オプション "-Wimplicit-function-declaration" は C/ObjC では有効ですが、C++ では有効ではありません
binder.cpp:20:0 からインクルードされたファイル:
project.h:85:0: 警告: "FD_SETSIZE" が再定義されました
:0:0: 注: これは前の定義の場所です
project.h:137:0 からインクルードされたファイルでは、
                 バインダー.cpp:20 から:
バインダー.h:35:34: 警告: 関数の戻り値の型で無視される型修飾子
project.h:138:0 からインクルードされたファイルでは、
                 バインダー.cpp:20 から:
em.h:91:47: 警告: 関数の戻り値の型で無視される型修飾子
em.h:92:76: 警告: 関数の戻り値の型で無視される型修飾子
em.h:93:56: 警告: 関数の戻り値の型で無視される型修飾子
em.h:95:57: 警告: 関数の戻り値の型で無視される型修飾子
em.h:96:60: 警告: 関数の戻り値の型で無視される型修飾子
em.h:97:58: 警告: 関数の戻り値の型で無視される型修飾子
em.h:98:55: 警告: 関数の戻り値の型で無視される型修飾子
em.h:99:36: 警告: 関数の戻り値の型で無視される型修飾子
em.h:101:47: 警告: 関数の戻り値の型で無視される型修飾子
em.h:106:42: 警告: 関数の戻り値の型で無視される型修飾子
em.h:123:45: 警告: 関数の戻り値の型で無視される型修飾子
em.h:132:36: 警告: 関数の戻り値の型で無視される型修飾子
project.h:145:0 からインクルードされたファイルでは、
                 バインダー.cpp:20 から:
eventmachine.h:45:61: 警告: 関数の戻り値の型で無視される型修飾子
eventmachine.h:46:112: 警告: 関数の戻り値の型で無視される型修飾子
eventmachine.h:47:69: 警告: 関数の戻り値の型で無視される型修飾子
eventmachine.h:49:73: 警告: 関数の戻り値の型で無視される型修飾子
eventmachine.h:62:75: 警告: 関数の戻り値の型で無視される型修飾子
eventmachine.h:63:74: 警告: 関数の戻り値の型で無視される型修飾子
eventmachine.h:64:77: 警告: 関数の戻り値の型で無視される型修飾子
eventmachine.h:65:41: 警告: 関数の戻り値の型で無視される型修飾子
project.h:145:0 からインクルードされたファイルでは、
                 バインダー.cpp:20 から:
eventmachine.h:99:60: 警告: 関数の戻り値の型で無視される型修飾子
eventmachine.h:100:58: 警告: 関数の戻り値の型で無視される型修飾子
eventmachine.h:102:60: 警告: 関数の戻り値の型で無視される型修飾子
eventmachine.h:105:41: 警告: 関数の戻り値の型で無視される型修飾子
cmain.cpp のコンパイル
cc1plus.exe: 警告: コマンド ライン オプション "-Wdeclaration-after-statement" は C/ObjC では有効ですが、C++ では有効ではありません
cc1plus.exe: 警告: コマンド ライン オプション "-Wimplicit-function-declaration" は C/ObjC では有効ですが、C++ では有効ではありません
cmain.cpp:20:0 からインクルードされたファイル:
project.h:85:0: 警告: "FD_SETSIZE" が再定義されました
:0:0: 注: これは前の定義の場所です
project.h:137:0 からインクルードされたファイルでは、
                 cmain.cpp:20 から:
バインダー.h:35:34: 警告: 関数の戻り値の型で無視される型修飾子
project.h:138:0 からインクルードされたファイルでは、
                 cmain.cpp:20 から:
em.h:91:47: 警告: 関数の戻り値の型で無視される型修飾子
em.h:92:76: 警告: 関数の戻り値の型で無視される型修飾子
em.h:93:56: 警告: 関数の戻り値の型で無視される型修飾子
em.h:95:57: 警告: 関数の戻り値の型で無視される型修飾子
em.h:96:60: 警告: 関数の戻り値の型で無視される型修飾子
em.h:97:58: 警告: 関数の戻り値の型で無視される型修飾子
em.h:98:55: 警告: 関数の戻り値の型で無視される型修飾子
em.h:99:36: 警告: 関数の戻り値の型で無視される型修飾子
em.h:101:47: 警告: 関数の戻り値の型で無視される型修飾子
em.h:106:42: 警告: 関数の戻り値の型で無視される型修飾子
em.h:123:45: 警告: 関数の戻り値の型で無視される型修飾子
em.h:132:36: 警告: 関数の戻り値の型で無視される型修飾子
project.h:145:0 からインクルードされたファイルでは、
                 cmain.cpp:20 から:
eventmachine.h:45:61: 警告: 関数の戻り値の型で無視される型修飾子
eventmachine.h:46:112: 警告: 関数の戻り値の型で無視される型修飾子
eventmachine.h:47:69: 警告: 関数の戻り値の型で無視される型修飾子
eventmachine.h:49:73: 警告: 関数の戻り値の型で無視される型修飾子
eventmachine.h:62:75: 警告: 関数の戻り値の型で無視される型修飾子
eventmachine.h:63:74: 警告: 関数の戻り値の型で無視される型修飾子
eventmachine.h:64:77: 警告: 関数の戻り値の型で無視される型修飾子
eventmachine.h:65:41: 警告: 関数の戻り値の型で無視される型修飾子
project.h:145:0 からインクルードされたファイルでは、
                 cmain.cpp:20 から:
eventmachine.h:99:60: 警告: 関数の戻り値の型で無視される型修飾子
eventmachine.h:100:58: 警告: 関数の戻り値の型で無視される型修飾子
eventmachine.h:102:60: 警告: 関数の戻り値の型で無視される型修飾子
eventmachine.h:105:41: 警告: 関数の戻り値の型で無視される型修飾子
cmain.cpp:98:71: 警告: 関数の戻り値の型で無視される型修飾子
cmain.cpp:109:122: 警告: 関数の戻り値の型で無視される型修飾子
cmain.cpp:119:79: 警告: 関数の戻り値の型で無視される型修飾子
cmain.cpp:129:83: 警告: 関数の戻り値の型で無視される型修飾子
cmain.cpp:260:85: 警告: 関数の戻り値の型で無視される型修飾子
cmain.cpp:270:84: 警告: 関数の戻り値の型で無視される型修飾子
cmain.cpp:280:88: 警告: 関数の戻り値の型で無視される型修飾子
cmain.cpp:290:51: 警告: 関数の戻り値の型で無視される型修飾子
cmain.cpp:300:70: 警告: 関数の戻り値の型で無視される型修飾子
cmain.cpp:320:55: 警告: 関数の戻り値の型で無視される型修飾子
cmain.cpp:546:70: 警告: 関数の戻り値の型で無視される型修飾子
cmain.cpp:669:68: 警告: 関数の戻り値の型で無視される型修飾子
cmain.cpp: 関数 'int evma_send_file_data_to_connection(long unsigned int, const char*)' 内:
cmain.cpp:752:6: エラー: 引数 '2' から 'int _fstati64(int, _stati64*)' の 'stat*' を '_stati64*' に変換できません
make: *** [cmain.o] エラー 1


Gem ファイルは、検査のために C:/Ruby193/lib/ruby/gems/1.9.1/gems/eventmachine-0.12.10 にインストールされたままになります。
結果は C:/Ruby193/lib/ruby/gems/1.9.1/gems/eventmachine-0.12.10/ext/gem_make.out に記録されます
于 2010-11-17T02:11:45.680 に答える
6

まず、RubyInstaller for Windows のWeb サイトから DevKit をインストールします (既にインストールされているようです)。

次に、Roger が示すように、git リポジトリとは別に eventmachine をインストールします。

> gem install specific_install
Successfully installed backports-1.18.1
Successfully installed specific_install-0.2.3
2 gems installed
...
> gem specific_install -l http://github.com/eventmachine/eventmachine.git
git installing from http://github.com/eventmachine/eventmachine.git
...
Successfully built RubyGem
Name: eventmachine
Version: 0.12.11
File: eventmachine-0.12.11.gem
Temporarily enhancing PATH to include DevKit...
Building native extensions.  This could take a while...
Successfully installed eventmachine-0.12.11
1 gem installed
...
successfully installed

その後、gem から thin をインストールできるはずです。

> gem install thin
Temporarily enhancing PATH to include DevKit...
Successfully installed thin-1.2.7-x86-mingw32
1 gem installed 
...
> thin start
Using rack adapter
Thin web server (v1.2.7 codename No Hup)
Maximum connections set to 1024
Listening on 0.0.0.0:3000, CTRL+C to stop
于 2010-09-22T12:16:46.957 に答える
3

これはあなたを助けるでしょう...

以下の行を gem ファイルに追加します

gem 'eventmachine', :git => 'https://github.com/eventmachine/eventmachine.git'

次にbundle installを実行します

于 2012-08-22T07:13:35.400 に答える
3

以下を実行してみてください

gem install thin –ignore-dependencies

失敗した場合は、rack と eventmachine のインストールを再試行してから、上記のコマンドを再実行してください。

gem install rack
gem install eventmachine -l
gem install thin –ignore-dependencies
于 2010-09-06T23:46:43.710 に答える
1

これは役立つかもしれません:

$ gem install specific_install
$ gem specific_install -l http://github.com/eventmachine/eventmachine.git
于 2010-09-07T16:56:15.743 に答える
0

事前にビルドされたバイナリを使用して、自分でビルドする必要なく Thin をインストールできますが、どのバイナリかを知る必要があります。ビルド済みの最新の win32 バージョンを取得するには、次の手順を実行します。

  1. RubyGems Thin ページに移動
  2. 「バージョン」セクションの下で、右側に「x86-mswin32」があるバージョンを探します。(現在、バージョン 1.2.11、1.2.10 などにはすべて win32 バイナリがあります)
  3. 次の「gem install」コマンドを、「-v」フラグに含まれる Thin のバージョンで実行します。

gem install thin -v 1.2.11

インストールの結果は次のとおりです。

c:\>gem install thin -v 1.2.11
thin-1.2.11-x86-mswin32 が正常にインストールされました
1つの宝石がインストールされています
thin-1.2.11-x86-mswin32 の ri ドキュメントをインストールしています...
ri クラス キャッシュを 3611 クラスで更新しています...
thin-1.2.11-x86-mswin32 の RDoc ドキュメントをインストールしています...
于 2011-12-11T17:52:24.997 に答える