Eventmachine gem安装失败

Vas*_*lka 28 ruby eventmachine

我无法安装eventmachine

好的,我知道这已被问了很多,但到目前为止我找不到任何解决方案帮助了我.所以我作为最后的手段在这里发布.

我使用( windows 8 x64通过ruby 2.0.0p195 (x64)Ruby Installer for Windows安装适当的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      
Run Code Online (Sandbox Code Playgroud)

事情我已经尝试gem "eventmachine", "~> 1.0.3"gem "eventmachine", "~> 1.0.0.beta.4.1"在我的Gemfile和删除/修改从EventMachine的gemfile.lock 制作新testapp和instaling EventMachine的有(失败)

我怀疑的事情我追踪了事件机器的依赖关系(可以在Rubygems上找到),我看到我既不能安装蓝布(显示更大的日志错误),也不能安装tidy-ext(bluecloth depencency)所以我认为它可能有一些相关性,也无法安装瘦

如有任何信息,请询问

谢谢大家!!

Fer*_*ira 59

我可以安装它,执行以下步骤:

1)尝试正常安装:

gem install eventmachine
Run Code Online (Sandbox Code Playgroud)

它获取了gem的1.0.3版本,但是由于变量声明的混乱而在make中失败了

2)编辑文件:

c:\Ruby200-x64\lib\ruby\gems\2.0.0\gems\eventmachine-1.0.3\ext\project.h
Run Code Online (Sandbox Code Playgroud)

并评论了第97行

//typedef int pid_t;
Run Code Online (Sandbox Code Playgroud)

要获得更强大的修正,请在此处查看解决方案https://github.com/eventmachine/eventmachine/pull/450/files

3)然后,我打开了命令提示符,然后转到gem文件夹

c:\Ruby200-x64\lib\ruby\gems\2.0.0\gems\eventmachine-1.0.3
Run Code Online (Sandbox Code Playgroud)

并运行:

gem build eventmachine.gemspec
Run Code Online (Sandbox Code Playgroud)

您需要在PATH中使用git.exe位置安装git才能使其正常工作(例如C:\ Users\YourUsername\AppData\Local\GitHub\PORTAB~1\bin).

4)它在文件夹上生成了一个eventmachine.gem文件...所以我把文件复制到了ac:\ tmp文件夹,然后转到那个文件夹,然后我输入了:

gem install eventmachine-1.0.3.gem --local
Run Code Online (Sandbox Code Playgroud)

它安装成功!

  • 有用!但这可能是因为这会导致事件机器出现问题,就像这个错误一样吗?`..'require':无法加载这样的文件 - eventmachine(LoadError)` (6认同)
  • 自从 Windows 开始让我感到害怕以来,我一直在使用 Ubuntu :P,当我登录到 Windows 时,我一定会尝试一下:) (2认同)
  • 是的 - 得到了与上面相同的错误.`C:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/thin-1.6.1/lib/thin.rb:7:'require':无法加载这样的文件 - eventmachine(LoadError)` (2认同)

小智 34

这对我有用:

brew link openssl --force 
Run Code Online (Sandbox Code Playgroud)


Cha*_*dru 11

我收到如下错误


C:\ Ruby200-x64\lib\ruby​​\gems\2.0.0\gems\eventmachine-1.0.3> gem build eventmachine.gemspec [eventmachine.gemspec]中的gemspec无效:没有这样的文件或目录 - git ls-files

错误:加载gemspec时出错.中止.

但是,我保持project.h在textpad中打开并尝试做gem install eventmachine.有一次,当从gem install命令获取新文件时,textpad将要求确认重新加载project.h ..只需重新加载并注释行// typedef int pid_t; ..然后编译经过..

基本上,在获取gem项目文件后需要一段时间才能开始编译.只是利用那个时间评论htis线..它对我有用..可能不适合每个人.

干杯!


小智 9

尝试

gem install eventmachine -- --with-cppflags=-I/usr/local/opt/openssl/include
Run Code Online (Sandbox Code Playgroud)


Õzb*_*bek 6

我遇到了同样的问题,并通过在开头添加以下内容成功运行它Gemfile

gem 'eventmachine', :git => 'git://github.com/eventmachine/eventmachine.git', :branch => 'master'
Run Code Online (Sandbox Code Playgroud)

在此之前我卸载了eventmachine.