2010-09-06 169 views
65

我無法在窗戶上安裝瘦身寶石。在構建本機擴展期間發生某些事情。無法在窗口上安裝瘦身

是否有人面臨同樣的問題?

這裏是堆棧跟蹤:

>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 
+0

什麼版本的紅寶石? – rogerdpack 2010-09-07 16:49:12

+1

紅寶石版本是1.9.2 – 2010-09-10 18:43:09

+1

我有這個相同的問題!我做了這些步驟,當我做'瘦開始'我得到一個錯誤'沒有找到適合C:/ Ruby192/bin的適配器。幫幫我? – Zabba 2010-10-22 23:28:07

回答

110

從混帳或RubyGems的倉庫不再有效(目前)1.9.2或1.9.3下安裝(確認仍破2012日至22日)。相反,你需要簡單:

gem install eventmachine --pre 
gem install thin 

注意,2012年日至18當前搶鮮爲renamed to 1.0.0.rc.1,所以有可能是「快」的與Windows Works版本將成爲正式發佈,這將不再是一個問題。


如果你試圖從GitHub庫,你可能會看到此1.9.2下建立的寶石(包括搜索引擎點擊):

 
C:\eventmachine> rake build 
(in C:/eventmachine) 
cd ext 
C:/Ruby/bin/ruby.exe extconf.rb 
checking for rb_trap_immediate in ruby.h,rubysig.h... *** 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. 

如果您嘗試安裝1.9.3從RubyGems的回購,你可能會看到這個下寶石(包括搜索引擎點擊):

C:\>gem install eventmachine 
Temporarily enhancing PATH to include DevKit... 
Building native extensions. This could take a while... 
ERROR: Error installing eventmachine: 
     ERROR: Failed to build gem native extension. 

     C:/Ruby193/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 
generating rubyeventmachine-i386-mingw32.def 
compiling binder.cpp 
cc1plus.exe: warning: command line option "-Wdeclaration-after-statement" is valid for C/ObjC but not for C++ 
cc1plus.exe: warning: command line option "-Wimplicit-function-declaration" is valid for C/ObjC but not for C++ 
In file included from binder.cpp:20:0: 
project.h:85:0: warning: "FD_SETSIZE" redefined 
:0:0: note: this is the location of the previous definition 
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 
compiling cmain.cpp 
cc1plus.exe: warning: command line option "-Wdeclaration-after-statement" is valid for C/ObjC but not for C++ 
cc1plus.exe: warning: command line option "-Wimplicit-function-declaration" is valid for C/ObjC but not for C++ 
In file included from cmain.cpp:20:0: 
project.h:85:0: warning: "FD_SETSIZE" redefined 
:0:0: note: this is the location of the previous definition 
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:/Ruby193/lib/ruby/gems/1.9.1/gems/eventmachine-0.12.10 for inspection. 
Results logged to C:/Ruby193/lib/ruby/gems/1.9.1/gems/eventmachine-0.12.10/ext/gem_make.out
+2

爲我工作的唯一解決方案。然而,安裝eventmachine工作的實際命令是:gem install eventmachine -v 1.0.0.beta.2 --pre – konung 2011-02-04 20:26:46

+0

對win7 x64有同樣的問題,這工作,謝謝! – 2011-03-09 12:45:55

+1

如果在事件機器安裝過程中出現'不能將'stat *'轉換爲'_stati64 *'錯誤,並且'gem install eventmachine --pre'也解決了我的問題。非常感謝 – cz3ch 2011-11-21 19:02:00

3

嘗試運行以下

gem install thin –ignore-dependencies 

如果失敗重試安裝架和EventMachine的,然後重新運行上面的命令。

gem install rack 
gem install eventmachine -l 
gem install thin –ignore-dependencies 
1

這可能幫助:

$ gem install specific_install 
$ gem specific_install -l http://github.com/eventmachine/eventmachine.git 
6

首先,從RubyInstaller的Windows website(它似乎你已經做了)安裝的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 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 
+1

gem specific_install -l http://github.com/eventmachine/eventmachine.git - 應該從git bush中調用。它不會在Windows控制檯中工作。 – 2010-10-07 11:57:38

0

您CA n安裝Thin無需使用預先構建的二進制文件自行構建,但需要知道哪些二進制文件。要獲取最新的預建的Win32版本做到以下幾點:

  1. 轉到爲具有「x86的mswin32」到它的正確版本的「版本」部分下RubyGems Thin page
  2. 看。 (截至今天的版本1.2.11,1.2。10,等等都具有的win32二進制文件)
  3. 運行下面的「寶石安裝」薄壁的版本命令包含在「-v」標誌的情況如下:

寶石安裝薄-v 1.2.11

下面是我的安裝結果:

 
c:\>gem install thin -v 1.2.11 
Successfully installed thin-1.2.11-x86-mswin32 
1 gem installed 
Installing ri documentation for thin-1.2.11-x86-mswin32... 
Updating ri class cache with 3611 classes... 
Installing RDoc documentation for thin-1.2.11-x86-mswin32... 
3

這將幫助你......

下面一行添加到您的寶石文件

寶石 'EventMachine的',:git的=> 'https://github.com/eventmachine/eventmachine.git'

然後運行捆綁安裝

+0

在Win 7 x64和Ruby 2.0.0中爲我工作。 – DanT 2014-07-09 12:51:53