如何在1.9.2上安装SystemTimer? [英] How to install SystemTimer on 1.9.2?

查看:79
本文介绍了如何在1.9.2上安装SystemTimer?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我刚刚使用RVM将我的应用程序从1.8.7升级到1.9.2,并且必须添加RubyGems和Bundler,运行软件包安装并让所有工作都可以工作,但SystemTimer除外。 Google-fu没有任何回报,并且我发现其他人在1.9版本中遇到了问题,但有些人已经完成了它的工作。任何想法?

  pawel:bodb pawel $ sudo gem install SystemTimer 
构建原生扩展。这可能需要一段时间...
/Users/pawel/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/site_ruby/1.9.1/rubygems/ext/builder.rb:48:警告:不安全的可写dir / usr / local / bin在PATH中,模式040777
错误:安装SystemTimer错误:
错误:无法构建gem本机扩展。

/Users/pawel/.rvm/rubies/ruby-1.9.2-p290/bin/ruby extconf.rb
创建Makefile

make
/usr/bin/gcc-4.2 -I。 -I / Users / pawel / .rvm / rubies / ruby​​-1.9.2-p290 / include / ruby​​-1.9.1 / x86_64-darwin10.3.0
-I / Users / pawel / .rvm / rubies / ruby -1.9.2-p290 / include / ruby​​-1.9.1 / ruby​​ / backward -I / Users / pawel / .rvm / rubies / ruby​​-1.9.2-p290 / include / ruby​​-1.9.1 -I。
-D_XOPEN_SOURCE -D_DARWIN_C_SOURCE -fno-common -O3 -ggdb -Wextra -Wno -unused-parameter -Wno-括号-Wpointer-arith -Wwrite-strings -Wno-missing-field-initializers
-Wshorten -64-to-32 -Wno-long-long -fno-common -pipe -o system_timer_native.o -c system_timer_native.c
从system_timer_native.c包含的文件中:8:
/ Users / pawel /.rvm/rubies/ruby-1.9.2-p290/include/ruby-1.9.1/ruby/backward/rubysig.h:14:2:warning:#warning ruby​​sig.h is obsolete
system_timer_native.c :在函数'install_first_timer_and_save_original_configuration'中:
system_timer_native.c:46:warning:传递'log_debug'的参数1丢弃指针目标类型的限定符
system_timer_native.c:53:warning:传递参数1'log_error '丢弃指针目标类型的限定符
system_timer_native.c:57:warning:传递'log_debug'的参数1丢弃指针目标类型的限定符
system_timer_native.c:62:warning: 'log_debug'丢弃指针目标类型的限定符
system_timer_native.c:65:warning:通过'log_error'的参数1丢弃指针目标类型的限定符
system_timer_native.c:69:warning:传递参数1 'log_debug'放弃指针目标类型的限定符
system_timer_native.c:82:warning:传递'log_error'的参数1丢弃指针目标类型的限定符
system_timer_native.c:89:warning: 'log_debug'放弃指针目标类型的限定符
system_timer_native.c:96:warning:通过'log_error'的参数1丢弃指针目标类型的限定符
system_timer_native.c:101:warning:传递参数1 'log_debug'放弃指针目标类型的限定符
system_timer_native.c:在函数'install_next_timer'中:
system_timer_native.c:112:warning:传递'log_debug'的参数1丢弃指针目标类型的限定符
系统em_timer_native.c:119:警告:传递'log_error'的参数1会丢弃指针目标类型的限定符
system_timer_native.c:123:warning:传递'log_debug'的参数1会丢弃指针目标类型的限定符
system_timer_native.c:130:warning:传递'log_error'的参数1会丢弃指针目标类型的限定符
system_timer_native.c:136:warning:传递'log_debug'的参数1会丢弃指针目标类型的限定符
system_timer_native.c:143:warning:传递'log_error'的参数1会丢弃指针目标类型的限定符
system_timer_native.c:146:warning:传递'log_debug'的参数1会丢弃指针目标类型的限定符
system_timer_native.c:在函数'restore_original_configuration'中:
system_timer_native.c:157:warning:传递'log_error'的参数1会丢弃指针目标类型的限定符
system_timer_native.c:160:警告:传递参数1的'log_debug'放弃指针目标类型的限定符
system_timer_native.c:168:warning:传递'log_error'的参数1丢弃指针目标类型的限定符
system_timer_native.c:170:warning: 'log_debug'丢弃指针目标类型的限定符
system_timer_native.c:172:warning:传递'log_error'的参数1丢弃指针目标类型的限定符
system_timer_native.c:函数'restore_original_timer_interval':
system_timer_native.c:190:warning:传递'log_error'的参数1会丢弃指针目标类型的限定符
system_timer_native.c:192:warning:传递'log_debug'的参数1会丢弃指针目标类型的限定符
system_timer_native.c:在函数'restore_sigalrm_mask'中:
system_timer_native.c:199:warning:传递'log_debug'的参数1丢弃指针目标类型的限定符
system_timer_native.c:201:warning:传递'log_debug'的参数1丢弃指针目标类型的限定符
system_timer_native.c:在函数'install_ruby_sigalrm_handler'中:
system_timer_native.c:211:错误:'rb_thread_critical'未声明(首次在此函数中使用)
system_timer_native.c:211:错误:(每个未声明的标识符只报告一次
system_timer_native.c:211:错误:对于它出现的每个函数)
system_timer_native.c:在函数'
system_timer_native.c:在函数'clear_pending_sigalrm_for_ruby_threads'中:
system_timer_native.c:217:error:'rb_thread_critical'未声明(在此函数中首次使用)
system_timer_native.c:警告:传递'log_debug'的参数1会丢弃指针目标类型的限定符
system_timer_native.c:函数'set_itimerval'中:
system_timer_native.c:290:警告:传递'log_debug'的参数1会丢弃限定符从指针目标typ e
system_timer_native.c:295:警告:隐式转换将64位值缩短为32位值
system_timer_native.c:299:警告:传递'log_debug'的参数1会丢弃指针目标中的限定符键入
make:*** [system_timer_native.o]错误1


Gem文件将保持安装在/Users/pawel/.rvm/rubies/ruby-1.9.2 -p290 / lib / ruby​​ / gems / 1.9.1 / gems / SystemTimer-1.2.3进行检查。
结果记录到/Users/pawel/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/gems/1.9.1/gems/SystemTimer-1.2.3/ext/system_timer/gem_make.out


解决方案

据我所知,SystemTimer不相关对于红宝石1.9,不应该使用这个版本。

在Ruby 1.9中使用这个gem是没用的,没有任何意义!系统定时器试图解决Ruby中使用的绿色线程模型的某些限制1.8(MRI)。有关更多信息,请参见 http://ph7spot.com/musings/system-timer 详情。


I've just upgraded my app from 1.8.7 to 1.9.2 using RVM and had to add RubyGems and Bundler, ran bundle install and got everything to work except SystemTimer. Google-fu returns nothing and I see others have had issue with it in 1.9 but some have gotten it to work. Any ideas?

pawel:bodb pawel$ sudo gem install SystemTimer
Building native extensions.  This could take a while...
/Users/pawel/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/site_ruby/1.9.1/rubygems/ext/builder.rb:48: warning: Insecure world writable dir /usr/local/bin in PATH, mode 040777
ERROR:  Error installing SystemTimer:
ERROR: Failed to build gem native extension.

/Users/pawel/.rvm/rubies/ruby-1.9.2-p290/bin/ruby extconf.rb
creating Makefile

make
/usr/bin/gcc-4.2 -I. -I/Users/pawel/.rvm/rubies/ruby-1.9.2-p290/include/ruby-1.9.1/x86_64-darwin10.3.0
-I/Users/pawel/.rvm/rubies/ruby-1.9.2-p290/include/ruby-1.9.1/ruby/backward -I/Users/pawel/.rvm/rubies/ruby-1.9.2-p290/include/ruby-1.9.1 -I.
-D_XOPEN_SOURCE -D_DARWIN_C_SOURCE   -fno-common -O3 -ggdb -Wextra -Wno-unused-parameter -Wno-parentheses -Wpointer-arith -Wwrite-strings -Wno-missing-field-initializers
-Wshorten-64-to-32 -Wno-long-long  -fno-common -pipe  -o system_timer_native.o -c system_timer_native.c
In file included from system_timer_native.c:8:
/Users/pawel/.rvm/rubies/ruby-1.9.2-p290/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’:
system_timer_native.c:46: warning: passing argument 1 of ‘log_debug’ discards qualifiers from pointer target type
system_timer_native.c:53: warning: passing argument 1 of ‘log_error’ discards qualifiers from pointer target type
system_timer_native.c:57: warning: passing argument 1 of ‘log_debug’ discards qualifiers from pointer target type
system_timer_native.c:62: warning: passing argument 1 of ‘log_debug’ discards qualifiers from pointer target type
system_timer_native.c:65: warning: passing argument 1 of ‘log_error’ discards qualifiers from pointer target type
system_timer_native.c:69: warning: passing argument 1 of ‘log_debug’ discards qualifiers from pointer target type
system_timer_native.c:82: warning: passing argument 1 of ‘log_error’ discards qualifiers from pointer target type
system_timer_native.c:89: warning: passing argument 1 of ‘log_debug’ discards qualifiers from pointer target type
system_timer_native.c:96: warning: passing argument 1 of ‘log_error’ discards qualifiers from pointer target type
system_timer_native.c:101: warning: passing argument 1 of ‘log_debug’ discards qualifiers from pointer target type
system_timer_native.c: In function ‘install_next_timer’:
system_timer_native.c:112: warning: passing argument 1 of ‘log_debug’ discards qualifiers from pointer target type
system_timer_native.c:119: warning: passing argument 1 of ‘log_error’ discards qualifiers from pointer target type
system_timer_native.c:123: warning: passing argument 1 of ‘log_debug’ discards qualifiers from pointer target type
system_timer_native.c:130: warning: passing argument 1 of ‘log_error’ discards qualifiers from pointer target type
system_timer_native.c:136: warning: passing argument 1 of ‘log_debug’ discards qualifiers from pointer target type
system_timer_native.c:143: warning: passing argument 1 of ‘log_error’ discards qualifiers from pointer target type
system_timer_native.c:146: warning: passing argument 1 of ‘log_debug’ discards qualifiers from pointer target type
system_timer_native.c: In function ‘restore_original_configuration’:
system_timer_native.c:157: warning: passing argument 1 of ‘log_error’ discards qualifiers from pointer target type
system_timer_native.c:160: warning: passing argument 1 of ‘log_debug’ discards qualifiers from pointer target type
system_timer_native.c:168: warning: passing argument 1 of ‘log_error’ discards qualifiers from pointer target type
system_timer_native.c:170: warning: passing argument 1 of ‘log_debug’ discards qualifiers from pointer target type
system_timer_native.c:172: warning: passing argument 1 of ‘log_error’ discards qualifiers from pointer target type
system_timer_native.c: In function ‘restore_original_timer_interval’:
system_timer_native.c:190: warning: passing argument 1 of ‘log_error’ discards qualifiers from pointer target type
system_timer_native.c:192: warning: passing argument 1 of ‘log_debug’ discards qualifiers from pointer target type
system_timer_native.c: In function ‘restore_sigalrm_mask’:
system_timer_native.c:199: warning: passing argument 1 of ‘log_debug’ discards qualifiers from pointer target type
system_timer_native.c:201: warning: passing argument 1 of ‘log_debug’ discards qualifiers from pointer target type
system_timer_native.c: In function ‘install_ruby_sigalrm_handler’:
system_timer_native.c:211: error: ‘rb_thread_critical’ undeclared (first use in this function)
system_timer_native.c:211: error: (Each undeclared identifier is reported only once
system_timer_native.c:211: error: for each function it appears in.)
system_timer_native.c: In function ‘restore_original_ruby_sigalrm_handler’:
system_timer_native.c:217: error: ‘rb_thread_critical’ undeclared (first use in this function)
system_timer_native.c: In function ‘clear_pending_sigalrm_for_ruby_threads’:
system_timer_native.c:266: warning: passing argument 1 of ‘log_debug’ discards qualifiers from pointer target type
system_timer_native.c: In function ‘set_itimerval’:
system_timer_native.c:290: warning: passing argument 1 of ‘log_debug’ discards qualifiers from pointer target type
system_timer_native.c:295: warning: implicit conversion shortens 64-bit value into a 32-bit value
system_timer_native.c:299: warning: passing argument 1 of ‘log_debug’ discards qualifiers from pointer target type
make: *** [system_timer_native.o] Error 1


Gem files will remain installed in /Users/pawel/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/gems/1.9.1/gems/SystemTimer-1.2.3 for inspection.
Results logged to /Users/pawel/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/gems/1.9.1/gems/SystemTimer-1.2.3/ext/system_timer/gem_make.out

解决方案

As far as I know, SystemTimer isn't relevant for ruby 1.9 and shouldn't use with this version.

"Using this gem in Ruby 1.9 is useless and does not make any sense! System Timer is trying to work around some limitation of the "green thread" model used in Ruby 1.8 (MRI). See http://ph7spot.com/musings/system-timer for more details."

这篇关于如何在1.9.2上安装SystemTimer?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆