0

優れたプログラマーのように、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」に関連しています。

cedar 10 バージョンでは、 にロックrjbしていましたv1.4.9。それにもかかわらず、これは cedar 14 で同じ問題を引き起こし、アップグレードしv1.5.3ても役に立ちませんでした。

gem を完全に削除するだけで開発中のアプリは問題なく動作rjbしますが、Heroku にアップロードすると完全に機能しなくなります (「アプリケーションでエラーが発生しました。数分後にもう一度お試しください」という死の画面)。

この同様の質問を見てきましたが、heroku は、提案された解決策である「ラボ」の追加を削除したようです。また、Gemfile で ENV['JAVA_HOME'] をいじって結果が得られませんでした。

私にはアイデアがありません。また、Heroku の mkmf.log ファイルをチェックして追加の手がかりを見つける方法についての情報も見つかりません。

gem install rjb -v '1.5.3'単独では問題なく動作しますが、アプリケーション全体をプッシュしようとしても何も変わりません。

Heroku で mkmf.log ファイルを確認するにはどうすればよいですか?

私が試すことができる rjb の代替手段はありますか (明らかに、Heroku は何かのためにそれが必要だと感じています。おそらく、エビを使用した PDF 生成)? Jruby について少し読んだことがありますが、Jruby では他の多くの gem がサポートされていないため、アプリケーションの残りの部分はおそらく機能しません。

私が見逃している他の明白な、または既存の解決策はありますか?

これが私の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
4

1 に答える 1

1

cedar-14 では、JAVA_HOME を次のように設定する必要があります。/usr/lib/jvm/java-1.7.0-openjdk-amd64/

于 2015-08-26T18:23:12.763 に答える