ruby heroku systemtimer问题

时间:2013-04-15 11:45:14

标签: ruby-on-rails heroku gemfile

我正在尝试将我的rails项目上传到heroku。我一直收到错误:

An error occurred while installing SystemTimer (1.2.3), and Bundler cannot
continue.

我做了一些研究并做了相应的修改,但它仍然没有用。首先,我尝试在我的gemfile中注释掉SystemTimer,但是没有这样做。我的heroku系统堆栈显然是Cedar 1.9.1。我的ruby版本是1.8.7。根据网上的一些研究,提出:

ruby '1.8.7'
gem文件中的

将恢复为Cedar 1.8.7,并相应地编译它,但这也不起作用。知道我能做什么吗?这是我一直得到的整个信息(不知道为什么1.9.1会出现,即使我在我的gemfile中明确说过1.8.7):

    Your bundle is complete! Use `bundle show [gemname]` to see where a bundled gem is installed.
christophecompaq@ubuntu:~/Populisto-heroku$ git push heroku master
Counting objects: 1347, done.
Compressing objects: 100% (871/871), done.
Writing objects: 100% (1347/1347), 3.09 MiB | 99 KiB/s, done.
Total 1347 (delta 426), reused 1033 (delta 276)

-----> Ruby/Rails app detected
-----> Installing dependencies using Bundler version 1.3.2
       Running: bundle install --without development:test --path vendor/bundle --binstubs vendor/bundle/bin --deployment
       Fetching gem metadata from https://rubygems.org/.......
       Fetching gem metadata from https://rubygems.org/..
       Installing rake (0.9.5)
       Installing SystemTimer (1.2.3)
       Gem::Installer::ExtensionBuildError: ERROR: Failed to build gem native extension.
       /usr/local/bin/ruby extconf.rb
       creating Makefile
       make
       gcc -I. -I/usr/local/include/ruby-1.9.1/x86_64-linux -I/usr/local/include/ruby-1.9.1/ruby/backward -I/usr/local/include/ruby-1.9.1 -I.   -fPIC -O3 -ggdb -Wextra -Wno-unused-parameter -Wno-parentheses -Wpointer-arith -Wwrite-strings -Wno-missing-field-initializers -Wno-long-long  -o system_timer_native.o -c system_timer_native.c
       In file included from system_timer_native.c:8:
       /usr/local/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:37: note: expected ‘char *’ but argument is of type ‘const char *’
       system_timer_native.c:53: warning: passing argument 1 of ‘log_error’ discards qualifiers from pointer target type
       system_timer_native.c:38: note: expected ‘char *’ but argument is of type ‘const char *’
       system_timer_native.c:57: warning: passing argument 1 of ‘log_debug’ discards qualifiers from pointer target type
       system_timer_native.c:37: note: expected ‘char *’ but argument is of type ‘const char *’
       system_timer_native.c:62: warning: passing argument 1 of ‘log_debug’ discards qualifiers from pointer target type
       system_timer_native.c:37: note: expected ‘char *’ but argument is of type ‘const char *’
       system_timer_native.c:65: warning: passing argument 1 of ‘log_error’ discards qualifiers from pointer target type
       system_timer_native.c:38: note: expected ‘char *’ but argument is of type ‘const char *’
       system_timer_native.c:69: warning: passing argument 1 of ‘log_debug’ discards qualifiers from pointer target type
       system_timer_native.c:37: note: expected ‘char *’ but argument is of type ‘const char *’
       system_timer_native.c:82: warning: passing argument 1 of ‘log_error’ discards qualifiers from pointer target type
       system_timer_native.c:38: note: expected ‘char *’ but argument is of type ‘const char *’
       system_timer_native.c:89: warning: passing argument 1 of ‘log_debug’ discards qualifiers from pointer target type
       system_timer_native.c:37: note: expected ‘char *’ but argument is of type ‘const char *’
       system_timer_native.c:96: warning: passing argument 1 of ‘log_error’ discards qualifiers from pointer target type
       system_timer_native.c:38: note: expected ‘char *’ but argument is of type ‘const char *’
       system_timer_native.c:101: warning: passing argument 1 of ‘log_debug’ discards qualifiers from pointer target type
       system_timer_native.c:37: note: expected ‘char *’ but argument is of type ‘const char *’
       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:37: note: expected ‘char *’ but argument is of type ‘const char *’
       system_timer_native.c:119: warning: passing argument 1 of ‘log_error’ discards qualifiers from pointer target type
       system_timer_native.c:38: note: expected ‘char *’ but argument is of type ‘const char *’
       system_timer_native.c:123: warning: passing argument 1 of ‘log_debug’ discards qualifiers from pointer target type
       system_timer_native.c:37: note: expected ‘char *’ but argument is of type ‘const char *’
       system_timer_native.c:130: warning: passing argument 1 of ‘log_error’ discards qualifiers from pointer target type
       system_timer_native.c:38: note: expected ‘char *’ but argument is of type ‘const char *’
       system_timer_native.c:136: warning: passing argument 1 of ‘log_debug’ discards qualifiers from pointer target type
       system_timer_native.c:37: note: expected ‘char *’ but argument is of type ‘const char *’
       system_timer_native.c:143: warning: passing argument 1 of ‘log_error’ discards qualifiers from pointer target type
       system_timer_native.c:38: note: expected ‘char *’ but argument is of type ‘const char *’
       system_timer_native.c:146: warning: passing argument 1 of ‘log_debug’ discards qualifiers from pointer target type
       system_timer_native.c:37: note: expected ‘char *’ but argument is of type ‘const char *’
       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:38: note: expected ‘char *’ but argument is of type ‘const char *’
       system_timer_native.c:160: warning: passing argument 1 of ‘log_debug’ discards qualifiers from pointer target type
       system_timer_native.c:37: note: expected ‘char *’ but argument is of type ‘const char *’
       system_timer_native.c:168: warning: passing argument 1 of ‘log_error’ discards qualifiers from pointer target type
       system_timer_native.c:38: note: expected ‘char *’ but argument is of type ‘const char *’
       system_timer_native.c:170: warning: passing argument 1 of ‘log_debug’ discards qualifiers from pointer target type
       system_timer_native.c:37: note: expected ‘char *’ but argument is of type ‘const char *’
       system_timer_native.c:172: warning: passing argument 1 of ‘log_error’ discards qualifiers from pointer target type
       system_timer_native.c:38: note: expected ‘char *’ but argument is of type ‘const char *’
       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:38: note: expected ‘char *’ but argument is of type ‘const char *’
       system_timer_native.c:192: warning: passing argument 1 of ‘log_debug’ discards qualifiers from pointer target type
       system_timer_native.c:37: note: expected ‘char *’ but argument is of type ‘const char *’
       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:37: note: expected ‘char *’ but argument is of type ‘const char *’
       system_timer_native.c:201: warning: passing argument 1 of ‘log_debug’ discards qualifiers from pointer target type
       system_timer_native.c:37: note: expected ‘char *’ but argument is of type ‘const char *’
       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:237: note: expected ‘char *’ but argument is of type ‘const char *’
       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:237: note: expected ‘char *’ but argument is of type ‘const char *’
       system_timer_native.c:299: warning: passing argument 1 of ‘log_debug’ discards qualifiers from pointer target type
       system_timer_native.c:237: note: expected ‘char *’ but argument is of type ‘const char *’
       make: *** [system_timer_native.o] Error 1
       Gem files will remain installed in /tmp/build_nn5uo1y1yyxf/vendor/bundle/ruby/1.9.1/gems/SystemTimer-1.2.3 for inspection.
       Results logged to /tmp/build_nn5uo1y1yyxf/vendor/bundle/ruby/1.9.1/gems/SystemTimer-1.2.3/ext/system_timer/gem_make.out
       An error occurred while installing SystemTimer (1.2.3), and Bundler cannot
       continue.
       Make sure that `gem install SystemTimer -v '1.2.3'` succeeds before bundling.
 !
 !     Failed to install gems via Bundler.
 !
 !     Heroku push rejected, failed to compile Ruby/rails app

3 个答案:

答案 0 :(得分:0)

答案 1 :(得分:0)

尝试一次heroku restart。您还可以使用ruby 1.9中的超时库作为SystemTimer的替代。

http://ruby-doc.org/stdlib-1.9.3/libdoc/timeout/rdoc/Timeout.html

答案 2 :(得分:0)

我得到了解决。问题似乎是,在我的更改之后,我从未将我的项目推送到github。我现在收到一个不同的错误,但它与系统计时器无关。谢谢你的帮助!