복붙노트

[RUBY-ON-RAILS] 어떻게 Heroku가에 레일 응용 프로그램을 배포하기 위해이 문제를 해결할 수 있습니까?

RUBY-ON-RAILS

어떻게 Heroku가에 레일 응용 프로그램을 배포하기 위해이 문제를 해결할 수 있습니까?

나는이 Heroku가에 응용 프로그램을 레일 배포하는 데 문제가 있어요.

내가 Heroku가 (자식 푸시 Heroku가 마스터) 내 프로젝트를 추진하려 할 때, 날이 오류를 준 :

Counting objects: 300, done.
Delta compression using up to 4 threads.
Compressing objects: 100% (269/269), done.
Writing objects: 100% (300/300), 255.34 KiB | 6.08 MiB/s, done.
Total 300 (delta 73), reused 0 (delta 0)
remote: Compressing source files... done.
remote: Building source:
remote: 
remote:  !     Warning: Multiple default buildpacks reported the ability to handle this app. The first buildpack in the list below will be used.
remote:             Detected buildpacks: Ruby,Node.js
remote:             See https://devcenter.heroku.com/articles/buildpacks#buildpack-detect-order
remote: -----> Ruby app detected
remote: -----> Compiling Ruby/Rails
remote:        Command: 'set -o pipefail; curl -L --fail --retry 5 --retry-delay 1 --connect-timeout 3 --max-time 30 https://s3-external-1.amazonaws.com/heroku-buildpack-ruby/heroku-18/ruby-2.3.5.tgz -s -o - | tar zxf - ' failed on attempt 1 of 3.
remote:        Command: 'set -o pipefail; curl -L --fail --retry 5 --retry-delay 1 --connect-timeout 3 --max-time 30 https://s3-external-1.amazonaws.com/heroku-buildpack-ruby/heroku-18/ruby-2.3.5.tgz -s -o - | tar zxf - ' failed on attempt 2 of 3.
remote: 
remote:  !
remote:  !     An error occurred while installing ruby-2.3.5
remote:  !     
remote:  !     This version of Ruby is not available on Heroku-18. The minimum supported version
remote:  !     of Ruby on the Heroku-18 stack can found at:
remote:  !     
remote:  !     https://devcenter.heroku.com/articles/ruby-support#supported-runtimes
remote:  !
remote:  !     Push rejected, failed to compile Ruby app.
remote: 
remote:  !     Push failed
remote: Verifying deploy...
remote: 
remote: !   Push rejected to agora-challenge.
remote: 
To https://git.heroku.com/agora-challenge.git
 ! [remote rejected] master -> master (pre-receive hook declined)
error: failed to push some refs to 'https://git.heroku.com/agora-challenge.git'

그러나 나는 Heroku가 18에 맞게 내 루비 버전을 변경했습니다.

나는 현재 호환되는 루비 버전 여기 https://devcenter.heroku.com/articles/ruby-support#supported-runtimes 검색

나는 RVM "루비 2.5.3"설치 설치된

나는 앱의 Gemfile에 선 루비 '2.5.3'추가

내가 설치 번들 실행 않았다 (없음 오류 메시지)

그리고 마지막으로, 내가 도망 않은 자식 푸시 Heroku가 마스터

내 Gemfile 여기

source 'https://rubygems.org'
ruby '2.5.3'


gem 'jbuilder', '~> 2.0'
gem 'pg', '~> 0.21'
gem 'puma'
gem 'rails', '5.1.6'
gem 'redis'

gem 'autoprefixer-rails'
gem 'bootstrap-sass', '~> 3.3'
gem 'font-awesome-sass', '~> 5.0.9'
gem 'sass-rails'
gem 'simple_form'
gem 'uglifier'
gem 'webpacker'
gem 'devise'

group :development do
  gem 'web-console', '>= 3.3.0'
end

group :development, :test do
  gem 'pry-byebug'
  gem 'pry-rails'
  gem 'listen', '~> 3.0.5'
  gem 'spring'
  gem 'spring-watcher-listen', '~> 2.0.0'
  gem 'dotenv-rails'
end

나는이 비슷한 질문 보았다에게 Heroku에 레일 응용 프로그램을 배포하는 데 문제를하지만 대답은 상기와 같은 링크로 이동하는 것이 좋습니다 ...

감사!

해결법

  1. ==============================

    1.나는 늦을 수도 솔루션을 게시하고 있지만, 다른 도움을 줄 수 있습니다. 솔루션 대부분의 사람들은 루비 버전을 업그레이드하라는 게시. 응용 프로그램에서 루비 버전을 업데이트하면 시간이 약간의 시간이 소요될 수 있습니다. 하지만 솔루션 응용 프로그램 아래에 루비 버전을 업데이트하지 않고 배포 할 수 있습니다.

    나는 늦을 수도 솔루션을 게시하고 있지만, 다른 도움을 줄 수 있습니다. 솔루션 대부분의 사람들은 루비 버전을 업그레이드하라는 게시. 응용 프로그램에서 루비 버전을 업데이트하면 시간이 약간의 시간이 소요될 수 있습니다. 하지만 솔루션 응용 프로그램 아래에 루비 버전을 업데이트하지 않고 배포 할 수 있습니다.

    현재 스택 Heroku가 사용하는 우분투 18.04의 이미지를 갖는 Heroku가-18이다. 그것은 최소한 여기에서, 런타임 루비 2.4.5 기타 정보를 지원했다.

    당신이 Heroku가 응용 프로그램에 대한 스택 다운 그레이드하기 위해 필요한이 루비 버전 아래로 응용 프로그램을 실행합니다.

    열기 콘솔과 Heroku가 실행 당신이 찾을 스택.

      cedar-14
      container
      heroku-16
    * heroku-18
    

    당신은 당신의 루비 버전을 지원 스택으로 다운 그레이드 할 필요가있다. 루비 인 2.3.x를 들어 당신에게 Heroku를-16을 설정할 수 있습니다

    heroku stack:set heroku-16
    

    당신이 Heroku가 스택 실행하면 이제 당신에게 Heroku를-16 찾을 수 귀하의 응용 프로그램에 대한 스택 설정합니다.

      cedar-14
      container
    * heroku-16
      heroku-18
    

    현재, 콘솔에 정보 보안 취약점 문제를 얻을 수 있습니다.

    시도 업데이트는 같은 최소한의 3.7.2에 보석을 스프라켓 :

    bundle update sprockets --bundler '3.7.2'
    

    또는 당신은 설정할 수 있습니다 :

    config.assets.compile = false # Disables security vulnerability
    

    자식 푸시 Heroku가 마스터를 실행합니다. 팔!! 응용 프로그램이 성공적으로 배포.

  2. ==============================

    2.당신은에서 2.5.3으로 .ruby 버전의 파일 특성을가집니다

    당신은에서 2.5.3으로 .ruby 버전의 파일 특성을가집니다

  3. from https://stackoverflow.com/questions/53354444/how-can-i-solve-this-trouble-to-deploy-a-rails-app-to-heroku by cc-by-sa and MIT license