heroku cronjob调度程序插件错误

时间:2015-07-24 14:21:56

标签: ruby-on-rails ruby ruby-on-rails-3 heroku

manish@ubuntu:~/project/myapp$  heroku addons:open scheduler
Opening scheduler:standard for myapp... failed
 !    Heroku client internal error.
 !    Search for help at: https://help.heroku.com
 !    Or report a bug at: https://github.com/heroku/heroku/issues/new

    Error:       ERROR: Failed to build gem native extension.

    /usr/bin/ruby1.9.1 extconf.rb
Ruby version is too old

extconf failed, exit code 1

Gem files will remain installed in /home/gagan/.rvm/gems/ruby-2.1.5/gems/byebug-4.0.5 for inspection.
Results logged to /home/gagan/.rvm/gems/ruby-2.1.5/extensions/x86-linux/1.9.1/byebug-4.0.5/gem_make.out
(Gem::Ext::BuildError)
Backtrace:   /usr/local/lib/site_ruby/1.9.1/rubygems/ext/builder.rb:89:in `run'
/usr/local/lib/site_ruby/1.9.1/rubygems/ext/ext_conf_builder.rb:38:in `block in build'
/usr/lib/ruby/1.9.1/tempfile.rb:320:in `open'
/usr/local/lib/site_ruby/1.9.1/rubygems/ext/ext_conf_builder.rb:17:in `build'
/usr/local/lib/site_ruby/1.9.1/rubygems/ext/builder.rb:161:in `block (2 levels) in build_extension'
/usr/local/lib/site_ruby/1.9.1/rubygems/ext/builder.rb:160:in `chdir'
/usr/local/lib/site_ruby/1.9.1/rubygems/ext/builder.rb:160:in `block in build_extension'
<internal:prelude>:10:in `synchronize'
/usr/local/lib/site_ruby/1.9.1/rubygems/ext/builder.rb:159:in `build_extension'
/usr/local/lib/site_ruby/1.9.1/rubygems/ext/builder.rb:198:in `block in build_extensions'
/usr/local/lib/site_ruby/1.9.1/rubygems/ext/builder.rb:195:in `each'
/usr/local/lib/site_ruby/1.9.1/rubygems/ext/builder.rb:195:in `build_extensions'
/usr/local/lib/site_ruby/1.9.1/rubygems/specification.rb:1436:in `block in build_extensions'
/usr/local/lib/site_ruby/1.9.1/rubygems/user_interaction.rb:45:in `use_ui'
/usr/local/lib/site_ruby/1.9.1/rubygems/specification.rb:1434:in `build_extensions'
/usr/local/lib/site_ruby/1.9.1/rubygems/stub_specification.rb:60:in `build_extensions'
/usr/local/lib/site_ruby/1.9.1/rubygems/basic_specification.rb:56:in `contains_requirable_file?'
/usr/local/lib/site_ruby/1.9.1/rubygems/specification.rb:925:in `block in find_inactive_by_path'
/usr/local/lib/site_ruby/1.9.1/rubygems/specification.rb:924:in `each'
/usr/local/lib/site_ruby/1.9.1/rubygems/specification.rb:924:in `find'
/usr/local/lib/site_ruby/1.9.1/rubygems/specification.rb:924:in `find_inactive_by_path'
/usr/local/lib/site_ruby/1.9.1/rubygems.rb:185:in `try_activate'
/usr/local/lib/site_ruby/1.9.1/rubygems/core_ext/kernel_require.rb:132:in `rescue in require'
/usr/local/lib/site_ruby/1.9.1/rubygems/core_ext/kernel_require.rb:144:in `require'
/usr/local/heroku/vendor/gems/addressable-2.3.2/lib/addressable/idna/native.rb:19:in `<top (required)>'
/usr/local/lib/site_ruby/1.9.1/rubygems/core_ext/kernel_require.rb:55:in `require'
/usr/local/lib/site_ruby/1.9.1/rubygems/core_ext/kernel_require.rb:55:in `require'
/usr/local/heroku/vendor/gems/addressable-2.3.2/lib/addressable/idna.rb:20:in `<top (required)>'
/usr/local/lib/site_ruby/1.9.1/rubygems/core_ext/kernel_require.rb:55:in `require'
/usr/local/lib/site_ruby/1.9.1/rubygems/core_ext/kernel_require.rb:55:in `require'
/usr/local/heroku/vendor/gems/addressable-2.3.2/lib/addressable/uri.rb:20:in `<top (required)>'
/usr/local/lib/site_ruby/1.9.1/rubygems/core_ext/kernel_require.rb:55:in `require'
/usr/local/lib/site_ruby/1.9.1/rubygems/core_ext/kernel_require.rb:55:in `require'
/usr/local/heroku/vendor/gems/launchy-2.4.2/lib/launchy.rb:1:in `<top (required)>'
/usr/local/lib/site_ruby/1.9.1/rubygems/core_ext/kernel_require.rb:55:in `require'
/usr/local/lib/site_ruby/1.9.1/rubygems/core_ext/kernel_require.rb:55:in `require'
/usr/local/heroku/lib/heroku/helpers.rb:327:in `block in launchy'
/usr/local/heroku/lib/heroku/helpers.rb:227:in `action'
/usr/local/heroku/lib/heroku/helpers.rb:326:in `launchy'
/usr/local/heroku/lib/heroku/command/addons.rb:179:in `open'
/usr/local/heroku/lib/heroku/command.rb:218:in `run'
/usr/local/heroku/lib/heroku/cli.rb:37:in `start'
/usr/bin/heroku:25:in `<main>'

    Command:     heroku addons:open scheduler
    Version:     heroku-toolbelt/3.9.0 (i686-linux) ruby/1.9.3

当我尝试heroku运行ruby -v我得到

  

ruby​​ 2.1.5p273(2014-11-13修订版48405)[x86_64-linux]

当我在本地尝试ruby -v时,我会得到这个版本的ruby

  

ruby​​ 2.1.5p273(2014-11-13修订版48405)[i686-linux]

当我将代码推送到heroku时,我得到以下一个

git push heroku master
Counting objects: 5, done.
Delta compression using up to 4 threads.
Compressing objects: 100% (3/3), done.
Writing objects: 100% (3/3), 287 bytes | 0 bytes/s, done.
Total 3 (delta 2), reused 0 (delta 0)
remote: Compressing source files... done.
remote: Building source:
remote: 
remote: -----> Ruby app detected
remote: -----> Compiling Ruby/Rails
remote: -----> Using Ruby version: ruby-2.1.5
remote: -----> Installing dependencies using 1.9.7
remote:        Running: bundle install --without development:test --path vendor/bundle --binstubs vendor/bundle/bin -j4 --deployment
remote:        Using i18n 0.7.0
remote:        Using json 1.8.2
remote:        Using rake 10.4.2
remote:        Using minitest 5.5.1
remote:        Using thread_safe 0.3.5
remote:        Using builder 3.2.2
remote:        Using erubis 2.7.0
remote:        Using mini_portile 0.6.2
remote:        Using rack 1.6.0
remote:        Using mime-types 2.4.3
remote:        Using arel 6.0.0
remote:        Using bcrypt 3.1.10
remote:        Using chronic 0.10.2
remote:        Using coffee-script-source 1.9.1.1
remote:        Using execjs 2.4.0
remote:        Using thor 0.19.1
remote:        Using bundler 1.9.7
remote:        Using hike 1.2.3
remote:        Using multi_json 1.11.0
remote:        Using tilt 1.4.1
remote:        Using daemons 1.2.1
remote:        Using orm_adapter 0.5.0
remote:        Using eventmachine 1.0.7
remote:        Using libv8 3.16.14.7
remote:        Using mysql2 0.3.18
remote:        Using pg 0.18.1
remote:        Using rack-offline 0.6.4 from git://github.com/wycats/rack-offline.git (at master)
remote:        Using rails_serve_static_assets 0.0.4
remote:        Using rails_stdout_logging 0.0.3
remote:        Using ref 1.0.5
remote:        Using rubyzip 1.1.7
remote:        Using will_paginate 3.0.7
remote:        Using rdoc 4.2.0
remote:        Using tzinfo 1.2.2
remote:        Using nokogiri 1.6.6.2
remote:        Using mail 2.6.3
remote:        Using rack-test 0.6.3
remote:        Using warden 1.2.3
remote:        Using coffee-script 2.4.1
remote:        Using uglifier 2.7.1
remote:        Using figaro 1.1.0
remote:        Using sprockets 2.12.3
remote:        Using thin 1.6.3
remote:        Using rails_12factor 0.0.3
remote:        Using therubyracer 0.12.1
remote:        Using activesupport 4.2.0
remote:        Using loofah 2.0.1
remote:        Using roo 2.0.1
remote:        Using sdoc 0.4.1
remote:        Using rails-deprecated_sanitizer 1.0.3
remote:        Using globalid 0.3.3
remote:        Using activemodel 4.2.0
remote:        Using climate_control 0.0.3
remote:        Using jbuilder 2.2.12
remote:        Using whenever 0.9.2
remote:        Using rails-html-sanitizer 1.0.2
remote:        Using rails-dom-testing 1.0.6
remote:        Using activejob 4.2.0
remote:        Using cocaine 0.5.7
remote:        Using activerecord 4.2.0
remote:        Using carrierwave 0.10.0
remote:        Using actionview 4.2.0
remote:        Using friendly_id 5.0.5
remote:        Using paperclip 4.2.1
remote:        Using actionpack 4.2.0
remote:        Using actionmailer 4.2.0
remote:        Using railties 4.2.0
remote:        Using sprockets-rails 2.2.4
remote:        Using coffee-rails 4.1.0
remote:        Using jquery-rails 4.0.3
remote:        Using rails 4.2.0
remote:        Using responders 2.1.0
remote:        Using jquery-ui-rails 5.0.3
remote:        Using rest_in_place 2.5.0
remote:        Using colorbox-rails 0.1.2
remote:        Using devise 3.4.1
remote:        Bundle complete! 28 Gemfile dependencies, 76 gems now installed.
remote:        Gems in the groups development and test were not installed.
remote:        Bundled gems are installed into ./vendor/bundle.
remote:        Bundle completed (0.65s)
remote:        Cleaning up the bundler cache.
remote: -----> Preparing app for Rails asset pipeline
remote:        Running: rake assets:precompile
remote:        Asset precompilation completed (6.42s)
remote:        Cleaning assets
remote:        Running: rake assets:clean
remote: 
remote: -----> Discovering process types
remote:        Procfile declares types -> web
remote:        Default types for Ruby  -> console, rake, worker
remote: 
remote: -----> Compressing... done, 51.6MB
remote: -----> Launching... done, v234
remote:        https://myapp.herokuapp.com/ deployed to Heroku
remote: 
remote: Verifying deploy.... done.

1 个答案:

答案 0 :(得分:1)

heroku不再支持您正在使用的Ruby版本(1.9.1)。 Github个人资料说明您至少需要使用1.9.3。 你在用rvm吗?如果没有,你仍然可以安装ruby 1.9.3,但要确保你没有使用任何过时的宝石,并在升级ruby后可能会破坏。

我没有使用heroku的经验。但是在this link之后你必须在你的Gemfile中声明你正在使用的ruby版本,是这样吗?

Gemfile
source "https://rubygems.org"
ruby "2.1.5"

要工作,可能需要重新启动并将您的应用推送到heroku。

您还应该进一步查看页面,了解如何在环境中指定所需的ruby版本.rb