Eventmachine gem 安装失败 [英] Eventmachine gem install fail
问题描述
我无法安装 eventmachine
I am not able to install eventmachine
好的,我知道这已经被问到了很多,但到目前为止我找到的任何解决方案都没有帮助我.所以我在这里发布作为最后的手段.
Ok I know this has been asked quite a lot, but no solutions I found has helped me so far.So I posted here as a last resort.
我使用 windows 8 x64
使用ruby 2.0.0p195 (x64)
(通过带有适当 Devkit 的 Windows Ruby 安装程序安装)
I use windows 8 x64
using ruby 2.0.0p195 (x64)
(installed throught Ruby Installer for Windows with the apropriate Devkit)
所以错误是
Gem::Installer::ExtensionBuildError: ERROR: Failed to build gem native extension
C:/Ruby200-x64/bin/ruby.exe extconf.rb
checking for main() in -lssl... no
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_wait_for_single_fd()... yes
checking for rb_enable_interrupt()... no
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
creating Makefile
make
generating rubyeventmachine-x64-mingw32.def
compiling binder.cpp
In file included from c:\users\btdy\downloads\devkit\mingw\bin\../lib/gcc/x86_64
-w64-mingw32/4.7.2/../../../../x86_64-w64-mingw32/include/process.h:12:0,
from c:/Ruby200-x64/include/ruby-2.0.0/ruby/win32.h:60,
from c:/Ruby200-x64/include/ruby-2.0.0/ruby/defines.h:153,
from c:/Ruby200-x64/include/ruby-2.0.0/ruby/ruby.h:70,
from c:/Ruby200-x64/include/ruby-2.0.0/ruby.h:33,
from em.h:24,
from project.h:150,
from binder.cpp:20:
c:\users\btdy\downloads\devkit\mingw\bin\../lib/gcc/x86_64-w64-mingw32/4.7.2/../
../../../x86_64-w64-mingw32/include/sys/types.h:68:16: error: conflicting declar
ation 'typedef _pid_t pid_t'
In file included from binder.cpp:20:0:
project.h:97:13: error: 'pid_t' has a previous declaration as 'typedef int pid_t
'
In file included from project.h:151:0,
from binder.cpp:20:
ed.h: In member function 'void EventableDescriptor::SetSocketInvalid()':
ed.h:43:40: warning: overflow in implicit constant conversion [-Woverflow]
make: *** [binder.o] Error 1
我尝试过的事情把 gem "eventmachine", "~> 1.0.3"
或 gem "eventmachine", "~> 1.0.0.beta.4.1"
在我的 gemfile 中,并从 gemfile.lock
中删除/修改 eventmachine制作一个新的测试应用程序并在那里安装 Eventmachine(失败)
Things I have tried putting gem "eventmachine", "~> 1.0.3"
or gem "eventmachine", "~> 1.0.0.beta.4.1"
in my gemfile and removed/modify eventmachine from gemfile.lock
making a new testapp and instaling Eventmachine there (fail)
我怀疑的事情 我追踪了 eventmachine 的依赖项(可以在 Rubygems 上找到),但发现我无法安装 bluecloth(显示更大的日志错误),我也不能安装 tidy-ext(bluecloth 依赖)所以我认为它可能有一些相关性,也不能安装薄
Things I suspect I tracked down dependencies for eventmachine(can be found on Rubygems) and I see that I cannot install bluecloth neither (shows even bigger log error) and neither can I install tidy-ext (bluecloth depencency) so I think it might have some relevance , also cannot install thin
有关任何信息,请询问
提前谢谢大家!!
推荐答案
我可以安装它,执行以下步骤:
I could install it, doing this steps:
1) 尝试正常安装:
gem install eventmachine
它获取了 gem 的 1.0.3 版本,但在 make 中失败,因为变量声明冲突
it fetched the version 1.0.3 of the gem, but failed in the make, because of a variable declaration conflit
2) 编辑文件:
c:\Ruby200-x64\lib\ruby\gems\2.0.0\gems\eventmachine-1.0.3\ext\project.h
并评论了第 97 行
//typedef int pid_t;
要获得更强大的修正,请在此处查看解决方案 https://github.com/eventmachine/eventmachine/pull/450/文件
for a more robust correction, checkout the solution here https://github.com/eventmachine/eventmachine/pull/450/files
3) 然后,我打开命令提示符,然后转到 gem 文件夹
3) then, i've opened command prompt, and went to the gem folder
c:\Ruby200-x64\lib\ruby\gems\2.0.0\gems\eventmachine-1.0.3
然后运行:
gem build eventmachine.gemspec
您需要使用 PATH 中的 git.exe 位置安装 git 才能使其工作(例如 C:\Users\YourUsername\AppData\Local\GitHub\PORTAB~1\bin).
You need git installed with the git.exe location in the PATH for this to work (such as C:\Users\YourUsername\AppData\Local\GitHub\PORTAB~1\bin).
4) 它在文件夹中生成了一个 eventmachine.gem 文件...所以我将一个文件复制到 c:\tmp 文件夹,然后转到该文件夹并从那里输入:
4) it generated a eventmachine.gem file on the folder... So I've copied a file to a c:\tmp folder, and went to that folder and from there, I've typed:
gem install eventmachine-1.0.3.gem --local
安装成功!
这篇关于Eventmachine gem 安装失败的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!