RJB在Heroku Cedar上工作得很好,在Cedar 14上莫名其妙地被打破了吗?

时间:2015-08-08 10:41:41

标签: ruby-on-rails ruby-on-rails-4 heroku cedar rjb

所以,就像一个优秀的程序员一样,我正准备申请即将过渡到Cedar-14

程序在Cedar 10上工作正常。对Cedar 14无效,RJB存在某种问题。当我尝试推送应用程序时,我得到的错误是:

Counting objects: 7, done.
Delta compression using up to 8 threads.
Compressing objects: 100% (7/7), done.
Writing objects: 100% (7/7), 635 bytes | 0 bytes/s, done.
Total 7 (delta 5), 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:        Fetching gem metadata from https://rubygems.org/...........
remote:        Fetching version metadata from https://rubygems.org/...
remote:        Fetching dependency metadata from https://rubygems.org/..
remote:        Using rake 10.4.2
remote:        Using i18n 0.7.0
remote:        Using json 1.8.3
remote:        Using minitest 5.8.0
remote:        Using thread_safe 0.3.5
remote:        Using builder 3.2.2
remote:        Using erubis 2.7.0
remote:        Using rack 1.5.5
remote:        Using mime-types 1.25.1
remote:        Using polyglot 0.3.5
remote:        Using arel 5.0.1.20140414130214
remote:        Using bcrypt 3.1.10
remote:        Using sass 3.2.19
remote:        Using cancancan 1.12.0
remote:        Using cocoon 1.2.6
remote:        Using coffee-script-source 1.9.1.1
remote:        Using CFPropertyList 2.3.1
remote:        Using execjs 2.5.2
remote:        Using thor 0.19.1
remote:        Using commonjs 0.2.7
remote:        Using currencies 0.4.2
remote:        Using i18n_data 0.7.0
remote:        Using orm_adapter 0.5.0
remote:        Using excon 0.45.4
remote:        Using formatador 0.2.5
remote:        Using net-ssh 2.9.2
remote:        Using mini_portile 0.6.2
remote:        Using multi_json 1.11.2
remote:        Using ipaddress 0.8.0
remote:        Using inflecto 0.0.2
remote:        Using tilt 1.4.1
remote:        Using sexp_processor 4.6.0
remote:        Using hike 1.2.3
remote:        Using libv8 3.16.14.11
remote:        Using nested_form 0.3.2
remote:        Using pdf-core 0.2.5
remote:        Using pdf-merger 0.3.2
remote:        Using pg 0.18.2
remote:        Using phony 2.14.13
remote:        Using ttfunk 1.2.2
remote:        Using bundler 1.9.7
remote:        Using rails_serve_static_assets 0.0.4
remote:        Using rails_stdout_logging 0.0.3
remote:        Using ref 2.0.0
remote:        Using tlsmail 0.0.1
remote:        Using rdoc 4.2.0
remote:        Using tzinfo 1.2.2
remote:        Using rack-test 0.6.3
remote:        Using warden 1.2.3
remote:        Using rack-cache 1.2
remote:        Using treetop 1.4.15
remote:        Using bootstrap-sass 3.1.1.1
remote:        Using validates_email_format_of 1.6.3
remote:        Using coffee-script 2.4.1
remote:        Using uglifier 2.7.1
remote:        Using figaro 1.1.1
remote:        Using less 2.6.0
remote:        Using net-scp 1.2.1
remote:        Using nokogiri 1.6.6.2
remote:        Using countries 0.11.5
remote:        Using haml 4.0.6
remote:        Using ruby_parser 3.7.1
remote:        Using prawn 1.1.0
remote:        Using rails_12factor 0.0.3
remote:        Using therubyracer 0.12.2
remote:        Using sprockets 2.12.4
remote:        Using sdoc 0.4.1
remote:        Using activesupport 4.1.0
remote:        Using fission 0.5.0
remote:        Using mail 2.5.4
remote:        Using fog-core 1.32.0
remote:        Using html2haml 2.0.0
remote:        Using actionview 4.1.0
remote:        Using activemodel 4.1.0
remote:        Using climate_control 0.0.3
remote:        Using jbuilder 1.5.3
remote:        Using phony_rails 0.12.9
remote:        Using fog-xml 0.1.2
remote:        Using fog-json 1.0.2
remote:        Using fog-local 0.2.1
remote:        Using actionpack 4.1.0
remote:        Using activerecord 4.1.0
remote:        Using carrierwave 0.10.0
remote:        Using cocaine 0.5.7
remote:        Using fog-vmfusion 0.1.0
remote:        Using fog-brightbox 0.8.0
remote:        Using fog-sakuracloud 1.0.1
remote:        Using fog-serverlove 0.1.2
remote:        Using fog-softlayer 0.4.7
remote:        Using fog-storm_on_demand 0.1.1
remote:        Using fog-atmos 0.1.0
remote:        Using fog-aws 0.7.4
remote:        Using fog-ecloud 0.1.1
remote:        Using fog-google 0.0.7
remote:        Using fog-powerdns 0.1.1
remote:        Using fog-profitbricks 0.0.5
remote:        Using fog-radosgw 0.0.4
remote:        Using fog-riakcs 0.1.0
remote:        Using fog-terremark 0.1.0
remote:        Using fog-voxel 0.1.0
remote:        Using actionmailer 4.1.0
remote:        Using railties 4.1.0
remote:        Using formtastic 2.2.1
remote:        Using less-rails 2.7.0
remote:        Using sprockets-rails 2.3.2
remote:        Using paperclip 4.2.4
remote:        Using fog 1.32.0
remote:        Using coffee-rails 4.0.1
remote:        Using responders 1.1.2
remote:        Using haml-rails 0.9.0
remote:        Using jquery-rails 3.1.3
remote:        Using formtastic-bootstrap 3.0.0
remote:        Using rails 4.1.0
remote:        Using mail_form 1.5.0 from git://github.com/plataformatec/mail_form (at master)
remote:        Using sass-rails 4.0.5
remote:        Using less-rails-bootstrap 3.3.5.0
remote:        Using turbolinks 2.5.3
remote:        Using devise 3.5.1
remote:        Using prawnto_2 0.2.6
remote:        Using rails_autolink 1.1.6
remote:        Gem::Ext::BuildError: ERROR: Failed to build gem native extension.
remote:        /tmp/build_fefc826e1bdbba09c960a4c215f98122/vendor/ruby-2.1.5/bin/ruby extconf.rb
remote:        *** extconf.rb failed ***
remote:        Could not create Makefile due to some reason, probably lack of necessary
remote:        libraries and/or headers.  Check the mkmf.log file for more details.  You may
remote:        need configuration options.
remote:        Provided configuration options:
remote:        --with-opt-dir
remote:        --without-opt-dir
remote:        --with-opt-include
remote:        --without-opt-include=${opt-dir}/include
remote:        --with-opt-lib
remote:        --without-opt-lib=${opt-dir}/lib
remote:        --with-make-prog
remote:        --without-make-prog
remote:        --srcdir=.
remote:        --curdir
remote:        --ruby=/tmp/build_fefc826e1bdbba09c960a4c215f98122/vendor/ruby-2.1.5/bin/ruby
remote:        extconf.rb:39:in `<main>': JAVA_HOME is not directory. (RuntimeError)
remote:        extconf failed, exit code 1
remote:        Gem files will remain installed in /tmp/build_fefc826e1bdbba09c960a4c215f98122/vendor/bundle/ruby/2.1.0/gems/rjb-1.5.3 for inspection.
remote:        Results logged to /tmp/build_fefc826e1bdbba09c960a4c215f98122/vendor/bundle/ruby/2.1.0/extensions/x86_64-linux/2.1.0-static/rjb-1.5.3/gem_make.out
remote:        An error occurred while installing rjb (1.5.3), and Bundler cannot continue.
remote:        Make sure that `gem install rjb -v '1.5.3'` succeeds before bundling.
remote:        Bundler Output: Fetching gem metadata from https://rubygems.org/...........
remote:        Fetching version metadata from https://rubygems.org/...
remote:        Fetching dependency metadata from https://rubygems.org/..
remote:        Using rake 10.4.2
remote:        Using i18n 0.7.0
remote:        Using json 1.8.3
remote:        Using minitest 5.8.0
remote:        Using thread_safe 0.3.5
remote:        Using builder 3.2.2
remote:        Using erubis 2.7.0
remote:        Using rack 1.5.5
remote:        Using mime-types 1.25.1
remote:        Using polyglot 0.3.5
remote:        Using arel 5.0.1.20140414130214
remote:        Using bcrypt 3.1.10
remote:        Using sass 3.2.19
remote:        Using cancancan 1.12.0
remote:        Using cocoon 1.2.6
remote:        Using coffee-script-source 1.9.1.1
remote:        Using CFPropertyList 2.3.1
remote:        Using execjs 2.5.2
remote:        Using thor 0.19.1
remote:        Using commonjs 0.2.7
remote:        Using currencies 0.4.2
remote:        Using i18n_data 0.7.0
remote:        Using orm_adapter 0.5.0
remote:        Using excon 0.45.4
remote:        Using formatador 0.2.5
remote:        Using net-ssh 2.9.2
remote:        Using mini_portile 0.6.2
remote:        Using multi_json 1.11.2
remote:        Using ipaddress 0.8.0
remote:        Using inflecto 0.0.2
remote:        Using tilt 1.4.1
remote:        Using sexp_processor 4.6.0
remote:        Using hike 1.2.3
remote:        Using libv8 3.16.14.11
remote:        Using nested_form 0.3.2
remote:        Using pdf-core 0.2.5
remote:        Using pdf-merger 0.3.2
remote:        Using pg 0.18.2
remote:        Using phony 2.14.13
remote:        Using ttfunk 1.2.2
remote:        Using bundler 1.9.7
remote:        Using rails_serve_static_assets 0.0.4
remote:        Using rails_stdout_logging 0.0.3
remote:        Using ref 2.0.0
remote:        Using tlsmail 0.0.1
remote:        Using rdoc 4.2.0
remote:        Using tzinfo 1.2.2
remote:        Using rack-test 0.6.3
remote:        Using warden 1.2.3
remote:        Using rack-cache 1.2
remote:        Using treetop 1.4.15
remote:        Using bootstrap-sass 3.1.1.1
remote:        Using validates_email_format_of 1.6.3
remote:        Using coffee-script 2.4.1
remote:        Using uglifier 2.7.1
remote:        Using figaro 1.1.1
remote:        Using less 2.6.0
remote:        Using net-scp 1.2.1
remote:        Using nokogiri 1.6.6.2
remote:        Using countries 0.11.5
remote:        Using haml 4.0.6
remote:        Using ruby_parser 3.7.1
remote:        Using prawn 1.1.0
remote:        Using rails_12factor 0.0.3
remote:        Using therubyracer 0.12.2
remote:        Using sprockets 2.12.4
remote:        Using sdoc 0.4.1
remote:        Using activesupport 4.1.0
remote:        Using fission 0.5.0
remote:        Using mail 2.5.4
remote:        Using fog-core 1.32.0
remote:        Using html2haml 2.0.0
remote:        Using actionview 4.1.0
remote:        Using activemodel 4.1.0
remote:        Using climate_control 0.0.3
remote:        Using jbuilder 1.5.3
remote:        Using phony_rails 0.12.9
remote:        Using fog-xml 0.1.2
remote:        Using fog-json 1.0.2
remote:        Using fog-local 0.2.1
remote:        Using actionpack 4.1.0
remote:        Using activerecord 4.1.0
remote:        Using carrierwave 0.10.0
remote:        Using cocaine 0.5.7
remote:        Using fog-vmfusion 0.1.0
remote:        Using fog-brightbox 0.8.0
remote:        Using fog-sakuracloud 1.0.1
remote:        Using fog-serverlove 0.1.2
remote:        Using fog-softlayer 0.4.7
remote:        Using fog-storm_on_demand 0.1.1
remote:        Using fog-atmos 0.1.0
remote:        Using fog-aws 0.7.4
remote:        Using fog-ecloud 0.1.1
remote:        Using fog-google 0.0.7
remote:        Using fog-powerdns 0.1.1
remote:        Using fog-profitbricks 0.0.5
remote:        Using fog-radosgw 0.0.4
remote:        Using fog-riakcs 0.1.0
remote:        Using fog-terremark 0.1.0
remote:        Using fog-voxel 0.1.0
remote:        Using actionmailer 4.1.0
remote:        Using railties 4.1.0
remote:        Using formtastic 2.2.1
remote:        Using less-rails 2.7.0
remote:        Using sprockets-rails 2.3.2
remote:        Using paperclip 4.2.4
remote:        Using fog 1.32.0
remote:        Using coffee-rails 4.0.1
remote:        Using responders 1.1.2
remote:        Using haml-rails 0.9.0
remote:        Using jquery-rails 3.1.3
remote:        Using formtastic-bootstrap 3.0.0
remote:        Using rails 4.1.0
remote:        Using mail_form 1.5.0 from git://github.com/plataformatec/mail_form (at master)
remote:        Using sass-rails 4.0.5
remote:        Using less-rails-bootstrap 3.3.5.0
remote:        Using turbolinks 2.5.3
remote:        Using devise 3.5.1
remote:        Using prawnto_2 0.2.6
remote:        Using rails_autolink 1.1.6
remote:        
remote:        Gem::Ext::BuildError: ERROR: Failed to build gem native extension.
remote:        
remote:        /tmp/build_fefc826e1bdbba09c960a4c215f98122/vendor/ruby-2.1.5/bin/ruby extconf.rb
remote:        *** extconf.rb failed ***
remote:        Could not create Makefile due to some reason, probably lack of necessary
remote:        libraries and/or headers.  Check the mkmf.log file for more details.  You may
remote:        need configuration options.
remote:        
remote:        Provided configuration options:
remote:        --with-opt-dir
remote:        --without-opt-dir
remote:        --with-opt-include
remote:        --without-opt-include=${opt-dir}/include
remote:        --with-opt-lib
remote:        --without-opt-lib=${opt-dir}/lib
remote:        --with-make-prog
remote:        --without-make-prog
remote:        --srcdir=.
remote:        --curdir
remote:        --ruby=/tmp/build_fefc826e1bdbba09c960a4c215f98122/vendor/ruby-2.1.5/bin/ruby
remote:        extconf.rb:39:in `<main>': JAVA_HOME is not directory. (RuntimeError)
remote:        
remote:        extconf failed, exit code 1
remote:        
remote:        Gem files will remain installed in /tmp/build_fefc826e1bdbba09c960a4c215f98122/vendor/bundle/ruby/2.1.0/gems/rjb-1.5.3 for inspection.
remote:        Results logged to /tmp/build_fefc826e1bdbba09c960a4c215f98122/vendor/bundle/ruby/2.1.0/extensions/x86_64-linux/2.1.0-static/rjb-1.5.3/gem_make.out
remote:        An error occurred while installing rjb (1.5.3), and Bundler cannot continue.
remote:        Make sure that `gem install rjb -v '1.5.3'` succeeds before bundling.
remote:  !
remote:  !     Failed to install gems via Bundler.
remote:  !
remote: 
remote:  !     Push rejected, failed to compile Ruby app
remote: 
remote: Verifying deploy...
remote: 

...然后是通常的“推弃拒绝”。

显然关键部分是

Gem::Ext::BuildError: ERROR: Failed to build gem native extension.
remote:        
remote:        /tmp/build_fefc826e1bdbba09c960a4c215f98122/vendor/ruby-2.1.5/bin/ruby extconf.rb
remote:        *** extconf.rb failed ***
remote:        Could not create Makefile due to some reason, probably lack of necessary
remote:        libraries and/or headers.  Check the mkmf.log file for more details.  You may
remote:        need configuration options.

pg或'rjb`相关。

在雪松10版本上,我已将rjb锁定到v1.4.9。然而,这对雪松14造成了同样的问题,并将其升级到v1.5.3没有帮助。

如果我完全删除rjb宝石,那么该应用程序的开发工作完全正常,但在上传到Heroku时会完全中断(“您的应用程序出错,请在几分钟内重试”屏幕死亡)。

我看过this similar question,但是heroku似乎已经删除了建议解决方案中添加的“实验室”。我也在我的Gemfile中弄乱了ENV ['JAVA_HOME']而没有结果。

我没有想法,我甚至找不到任何有关如何检查Heroku上的mkmf.log文件的信息,以获取任何额外的线索。

gem install rjb -v '1.5.3'可以自行运行,但在我尝试推送整个应用程序时不会改变任何内容。

如何检查Heroku上的mkmf.log文件?

我可以尝试使用rjb的替代方案(显然Heroku认为它需要它用于某些东西,可能是用PDF生成PDF)?我已经阅读了一些关于Jruby的内容,但显然其中很多其他宝石都不受支持,因此我的应用程序的其余部分可能无效。

是否还有一些其他明显或现有的解决方案我缺席了?

这是我的Gemfile:

source 'https://rubygems.org'

ruby '2.1.5'

# Required to get rjb (and therefore PDF merger) working on Heroku
# https://stackoverflow.com/questions/9823487/cant-deploy-to-heroku-the-app-with-rjb-gem/9891161#9891161
# This directory changed from Heroku "cedar" stack to "cedar 14" stack
# It may need to be updated if Heroku updates their stack again, and rjb/pg will not install
# Will throw an error like this
# Gem::Ext::BuildError: ERROR: Failed to build gem native extension.
# remote:        
# remote:        /tmp/build_943bcf5ec8b7d2ff7b74f56f3b28db62/vendor/ruby-2.1.5/bin/ruby extconf.rb
# remote:        *** extconf.rb failed ***
# remote:        Could not create Makefile due to some reason, probably lack of necessary
# remote:        libraries and/or headers.  Check the mkmf.log file for more details.  You may
# remote:        need configuration options.
java_home = '/usr/lib/jvm/java-6-openjdk'
ENV['JAVA_HOME'] = java_home if Dir.exist?(java_home)
gem 'rjb'

gem 'rails', '4.1.0' # Bundle edge Rails instead: gem 'rails', github: 'rails/rails'
gem 'pg' # Use postgresql as the database for Active Record
gem 'sass-rails', '~> 4.0.0' # Use SCSS for stylesheets
gem 'bootstrap-sass', '~> 3.1.1'
gem 'uglifier', '>= 1.3.0' # Use Uglifier as compressor for JavaScript assets
gem 'coffee-rails', '~> 4.0.0' # Use CoffeeScript for .js.coffee assets and views
gem 'jquery-rails' # Use jquery as the JavaScript library
gem 'turbolinks' # Turbolinks makes following links in your web application faster. Read more: https://github.com/rails/turbolinks
gem 'jbuilder', '~> 1.2' # Build JSON APIs with ease. Read more: https://github.com/rails/jbuilder

# See https://github.com/sstephenson/execjs#readme for more supported runtimes
gem 'therubyracer', platforms: :ruby
gem 'less-rails-bootstrap'

gem 'devise'
gem 'cancancan', '~> 1.9'
gem 'formtastic', '2.2.1'
gem 'formtastic-bootstrap'
gem 'cocoon'
gem 'haml'
gem 'haml-rails'
gem 'rails_autolink'
gem 'validates_email_format_of'
gem 'figaro'

gem 'prawn', '1.1.0' # Updating this breaks the 'prawn/table functionality'
gem 'prawnto_2', '0.2.6', :require => "prawnto"
#gem 'prawn-templates'
gem 'paperclip', '~> 4.2.0'
gem 'tlsmail', require: false # See config/initializers/tlsmail.rb
gem 'carrierwave'
gem 'fog'
gem 'nested_form'
gem 'phony_rails'
gem 'pdf-merger'

gem 'mail_form', :git => 'git://github.com/plataformatec/mail_form'

group :doc do
  # bundle exec rake doc:rails generates the API under doc/api.
  gem 'sdoc', require: false
end

group :development, :test do
  gem 'rspec-rails'
  gem 'rspec-activemodel-mocks'
  gem 'factory_girl_rails'
  gem 'better_errors'
  gem 'binding_of_caller'
end

group :test do
  gem 'shoulda-matchers'
  gem 'database_cleaner'
  gem 'selenium-webdriver'
  gem 'faker'
  gem 'capybara'
  gem 'launchy'
  gem 'pdf-inspector', require: "pdf/inspector"
end

group :production do
  gem 'rails_12factor' # Enable Heroku production
  gem 'rack-cache' # Enable rack-caching for production environment and Prawn email attachment
end

# Use ActiveModel has_secure_password
# gem 'bcrypt-ruby', '~> 3.0.0'

# Use unicorn as the app server
# gem 'unicorn'

# Use Capistrano for deployment
# gem 'capistrano', group: :development

1 个答案:

答案 0 :(得分:1)

在cedar-14上,您必须将JAVA_HOME设置为/usr/lib/jvm/java-1.7.0-openjdk-amd64/