我正在尝试安装eventmachine,所以我可以运行这个程序https://github.com/alexagranov/earnings_date_finder 来查看它的功能.
我收到此错误:
C:\Users\Dakota\Downloads\rails\rails_apps\earnings>ruby script/rails
Could not find eventmachine-0.12.10 in any of the sources
Run `bundle install` to install missing gems.
Run Code Online (Sandbox Code Playgroud)
当我运行'bundle install'时,我得到了这个:
C:\Users\Dakota\Downloads\rails\rails_apps\earnings>bundle install
Fetching gem metadata from http://rubygems.org/.........
Fetching gem metadata from http://rubygems.org/..
Resolving dependencies...
Using rake (0.9.2.2)
Using abstract (1.0.0)
Using activesupport (3.0.11)
Using builder (2.1.2)
Using i18n (0.5.0)
Using activemodel (3.0.11)
Using erubis (2.6.6)
Using rack (1.2.4)
Using rack-mount (0.6.14)
Using rack-test (0.5.7)
Using tzinfo (0.3.31)
Using actionpack (3.0.11)
Using mime-types (1.17.2)
Using polyglot (0.3.3)
Using treetop (1.4.10)
Using mail (2.2.19)
Using actionmailer (3.0.11)
Using arel (2.0.10)
Using activerecord (3.0.11)
Using activeresource (3.0.11)
Using archive-tar-minitar (0.5.2)
Using bundler (1.3.5)
Using columnize (0.3.4)
Using daemons (1.1.4)
Installing eventmachine (0.12.10)
Gem::Installer::ExtensionBuildError: ERROR: Failed to build gem native extension
.
C:/Users/Dakota/Downloads/rails/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. 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
--without-make-prog
--srcdir=.
--curdir
--ruby=C:/Users/Dakota/Downloads/rails/ruby/bin/ruby
C:/Users/Dakota/Downloads/rails/ruby/lib/ruby/2.0.0/mkmf.rb:431:in `try_do':
The compiler failed to generate an executable file. (RuntimeError)
You have to install development tools first.
from C:/Users/Dakota/Downloads/rails/ruby/lib/ruby/2.0.0/mkmf.rb:546:
in `block in try_compile'
from C:/Users/Dakota/Downloads/rails/ruby/lib/ruby/2.0.0/mkmf.rb:499:
in `with_werror'
from C:/Users/Dakota/Downloads/rails/ruby/lib/ruby/2.0.0/mkmf.rb:546:
in `try_compile'
from C:/Users/Dakota/Downloads/rails/ruby/lib/ruby/2.0.0/mkmf.rb:736:
in `try_var'
from C:/Users/Dakota/Downloads/rails/ruby/lib/ruby/2.0.0/mkmf.rb:1023
:in `block in have_var'
from C:/Users/Dakota/Downloads/rails/ruby/lib/ruby/2.0.0/mkmf.rb:892:
in `block in checking_for'
from C:/Users/Dakota/Downloads/rails/ruby/lib/ruby/2.0.0/mkmf.rb:337:
in `block (2 levels) in postpone'
from C:/Users/Dakota/Downloads/rails/ruby/lib/ruby/2.0.0/mkmf.rb:307:
in `open'
from C:/Users/Dakota/Downloads/rails/ruby/lib/ruby/2.0.0/mkmf.rb:337:
in `block in postpone'
from C:/Users/Dakota/Downloads/rails/ruby/lib/ruby/2.0.0/mkmf.rb:307:
in `open'
from C:/Users/Dakota/Downloads/rails/ruby/lib/ruby/2.0.0/mkmf.rb:333:
in `postpone'
from C:/Users/Dakota/Downloads/rails/ruby/lib/ruby/2.0.0/mkmf.rb:891:
in `checking_for'
from C:/Users/Dakota/Downloads/rails/ruby/lib/ruby/2.0.0/mkmf.rb:1022
:in `have_var'
from extconf.rb:16:in `<main>'
Gem files will remain installed in C:/Users/hgc33_000/Downloads/rails/ruby/lib/r
uby/gems/2.0.0/gems/eventmachine-0.12.10 for inspection.
Results logged to C:/Users/hgc33_000/Downloads/rails/ruby/lib/ruby/gems/2.0.0/ge
ms/eventmachine-0.12.10/ext/gem_make.out
An error occurred while installing eventmachine (0.12.10), and Bundler cannot
continue.
Make sure that `gem install eventmachine -v '0.12.10'` succeeds before bundling.
Run Code Online (Sandbox Code Playgroud)
我已经尝试了许多不同的方法来安装eventmachine,但每种方式都给我同样的错误.
对于记录'gem install eventmachine --pre'给我这个错误:
C:\Users\Dakota\Downloads\rails\rails_apps\earnings>gem install eventmachine --pre
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:/Users/Dakota/Downloads/rails/ruby/bin/ruby.exe extconf.rb
checking for main() in -lssl... *** 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
--without-make-prog
--srcdir=.
--curdir
--ruby=C:/Users/Dakota/Downloads/rails/ruby/bin/ruby
--with-openssl-config
--without-openssl-config
--with-pkg-config
--without-pkg-config
--with-ssl-dir
--without-ssl-dir
--with-ssl-include
--without-ssl-include=${ssl-dir}/include
--with-ssl-lib
--without-ssl-lib=${ssl-dir}/
--with-ssllib
--without-ssllib
C:/Users/hgc33_000/Downloads/rails/ruby/lib/ruby/2.0.0/mkmf.rb:431:in `try_do':
The compiler failed to generate an executable file. (RuntimeError)
You have to install development tools first.
from C:/Users/Dakota/Downloads/rails/ruby/lib/ruby/2.0.0/mkmf.rb:516:
in `try_link0'
from C:/Users/Dakota/Downloads/rails/ruby/lib/ruby/2.0.0/mkmf.rb:531:
in `try_link'
from C:/Users/Dakota/Downloads/rails/ruby/lib/ruby/2.0.0/mkmf.rb:717:
in `try_func'
from C:/Users/Dakota/Downloads/rails/ruby/lib/ruby/2.0.0/mkmf.rb:947:
in `block in have_library'
from C:/Users/Dakota/Downloads/rails/ruby/lib/ruby/2.0.0/mkmf.rb:892:
in `block in checking_for'
from C:/Users/Dakota/Downloads/rails/ruby/lib/ruby/2.0.0/mkmf.rb:337:
in `block (2 levels) in postpone'
from C:/Users/Dakota/Downloads/rails/ruby/lib/ruby/2.0.0/mkmf.rb:307:
in `open'
from C:/Users/Dakota/Downloads/rails/ruby/lib/ruby/2.0.0/mkmf.rb:337:
in `block in postpone'
from C:/Users/Dakota/Downloads/rails/ruby/lib/ruby/2.0.0/mkmf.rb:307:
in `open'
from C:/Users/Dakota/Downloads/rails/ruby/lib/ruby/2.0.0/mkmf.rb:333:
in `postpone'
from C:/Users/Dakota/Downloads/rails/ruby/lib/ruby/2.0.0/mkmf.rb:891:
in `checking_for'
from C:/Users/Dakota/Downloads/rails/ruby/lib/ruby/2.0.0/mkmf.rb:942:
in `have_library'
from extconf.rb:5:in `block in check_libs'
from extconf.rb:5:in `each'
from extconf.rb:5:in `all?'
from extconf.rb:5:in `check_libs'
from extconf.rb:39:in `manual_ssl_config'
from extconf.rb:61:in `<main>'
Gem files will remain installed in C:/Users/Dakota/Downloads/rails/ruby/lib/r
uby/gems/2.0.0/gems/eventmachine-1.0.3 for inspection.
Results logged to C:/Users/Dakota/Downloads/rails/ruby/lib/ruby/gems/2.0.0/ge
ms/eventmachine-1.0.3/ext/gem_make.out
Run Code Online (Sandbox Code Playgroud)
我可以安装它,执行以下步骤:
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)
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)
4)它在文件夹上生成了一个eventmachine.gem文件...所以我把文件复制到了ac:\ tmp文件夹,然后转到那个文件夹,然后我输入了:
gem install eventmachine-1.0.3.gem --local
Run Code Online (Sandbox Code Playgroud)
它安装成功!
| 归档时间: |
|
| 查看次数: |
3170 次 |
| 最近记录: |