Ruby on Rails - 无法安装SystemTimer

Gee*_*Out 6 rubygems ruby-on-rails ruby-1.9

我正在使用Windows,我只是运行命令:

C:\Sites\cmply>gem install SystemTimer -v '1.2.3'
Run Code Online (Sandbox Code Playgroud)

我收到了这个错误:

Temporarily enhancing PATH to include DevKit...
Building native extensions.  This could take a while...
ERROR:  Error installing SystemTimer:
        ERROR: Failed to build gem native extension.

        C:/RailsInstaller/Ruby1.9.3/bin/ruby.exe extconf.rb
creating Makefile

make
generating system_timer_native-i386-mingw32.def
compiling system_timer_native.c
In file included from system_timer_native.c:8:0:
c:/RailsInstaller/Ruby1.9.3/include/ruby-1.9.1/ruby/backward/rubysig.h:14:2: warning: #warning rubysig.h is obsolete
system_timer_native.c: In function 'install_first_timer_and_save_original_configuration':
Run Code Online (Sandbox Code Playgroud)

任何想法为什么?在此之前,我又遇到了一个可疑的错误:

Gem files will remain installed in C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/SystemTimer-1.2.3 for inspection.
Results logged to C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/SystemTimer-1.2.3/ext/system_timer/gem_make.out
An error occured while installing SystemTimer (1.2.3), and Bundler cannot continue.
Make sure that `gem install SystemTimer -v '1.2.3'` succeeds before bundling.
Run Code Online (Sandbox Code Playgroud)

在此之前,我得到了另一个错误,似乎表明我的Ruby版本在某种程度上不同步:

C:\Sites\cmply>bundle update rake
Updating git://github.com/twitter/twitter-text-rb.git
Fetching source index for http://rubygems.org/
Bundler could not find compatible versions for gem "activesupport":
  In snapshot (Gemfile.lock):
    activesupport (3.2.3)

  In Gemfile:
    rails (= 3.1.3) x86-mingw32 depends on
      activesupport (= 3.1.3) x86-mingw32

Running `bundle update` will rebuild your snapshot from scratch, using only
the gems in your Gemfile, which may resolve the conflict.
Run Code Online (Sandbox Code Playgroud)

所有根源于我有一个不兼容的红宝石版本?该如何解决?

谢谢!

Luk*_*kal 19

你不能用ruby 1.9安装system_timer gem,但它不是bug,它是一个功能.这是完整的解释.

"只有在运行Ruby 1.8时,system_timer才有意义.如果运行Ruby 1.9,则不需要它."

如果您从Ruby 1.8切换到1.9,只需删除system_time gem并更新处理超时的代码.


KAR*_*ván 3

检查输出,它表明您正在使用 1.9.1 的包含文件为 Ruby 1.9.3 构建。

您的 Ruby 安装似乎已损坏。我会尝试重新安装 Ruby 1.9.3 并检查包含文件c:/RailsInstaller/Ruby1.9.3/include/ruby-1.9.3/是否存在于c:/RailsInstaller/Ruby1.9.3/include/ruby-1.9.1/.