【问题标题】:Ruby on Rails - can not install SystemTimerRuby on Rails - 无法安装 SystemTimer
【发布时间】:2012-04-12 15:05:07
【问题描述】:

我使用的是 windows,我只是运行了命令:

C:\Sites\cmply>gem install SystemTimer -v '1.2.3'

我得到了这个错误:

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':

知道为什么吗?在此之前,我遇到了另一个可疑错误:

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.

在此之前,我遇到了另一个错误,似乎表明我的 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.

所以这一切都是因为我有一个不兼容的 ruby​​ 版本吗?这个应该怎么解决?

谢谢!

【问题讨论】:

  • Ruby 有其默认的Time 类。为什么你需要另一个宝石呢?
  • 您能提供您的 Ruby 版本吗? ruby -v 命令的输出。
  • @uDaY SystemTimer 不等同于 Time 类,它完全不同。
  • @KARASZIIstván,是的,刚刚阅读了有关宝石的信息。很高兴知道谢谢!
  • @KARASZIIstván ruby​​ 1.9.3p125 (2012-02-16) [i386-mingw32]

标签: ruby-on-rails rubygems ruby-1.9


【解决方案1】:

您无法使用 ruby​​ 1.9 安装 system_timer gem,但这不是错误,而是一项功能。这是full explanation

"system_timer 仅在您运行 Ruby 1.8 时才相关。您不需要 如果您正在运行 Ruby 1.9,则需要它"

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

【讨论】:

    【解决方案2】:

    使用 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/

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2014-11-17
      • 2013-12-16
      • 2013-05-21
      • 2018-06-25
      • 1970-01-01
      相关资源
      最近更新 更多