gpt4 book ai didi

ruby-on-rails - 无法将 Rails 应用程序部署到 Heroku

转载 作者:行者123 更新时间:2023-12-01 05:02:50 25 4
gpt4 key购买 nike

我无法将 Rails 应用程序部署到 Heroku。 Heroku 给了我错误消息 An error occurred while installing Ruby ruby-2.1.1毕竟我已经将所有内容设置为 ruby​​ 2.0.0,这让我感到困惑。
有任何想法吗?谢谢!

到目前为止我的步骤:

  • 我在这里搜索 https://devcenter.heroku.com/articles/ruby-support#supported-runtimes对于当前兼容的 ruby​​ 版本。
  • 我在我的电脑上通过 RVM 安装了 Ruby 2.0.0 版
  • 我确保使用了这个版本:rvm use ruby-2.0.0
  • 我将 ruby​​ '2.0.0' 行添加到应用程序的 Gemfile
  • 我确实跑了 bundle install (无错误消息)
  • 我确实跑了 git push heroku master

  • Heroku 错误消息:
       > ~/Desktop/blog(heroku_deploy) git push heroku master
    Counting objects: 61, done.
    Delta compression using up to 8 threads.
    Compressing objects: 100% (49/49), done.
    Writing objects: 100% (61/61), 14.77 KiB | 0 bytes/s, done.
    Total 61 (delta 26), reused 41 (delta 7)
    remote: Compressing source files... done.
    remote: Building source:
    remote:
    remote: -----> Removing .DS_Store files
    remote: -----> Ruby app detected
    remote: -----> Compiling Ruby/Rails
    remote: !
    remote: ! An error occurred while installing Ruby ruby-2.1.1
    remote: ! For supported Ruby versions see https://devcenter.heroku.com/articles/ruby-support#supported-runtimes
    remote: ! Note: Only the most recent version of Ruby 2.1 is supported on Cedar-14
    remote: ! Command: 'set -o pipefail; curl --fail --retry 3 --retry-delay 1 --connect-timeout 3 --max-time 30 https://s3-external-1.amazonaws.com/heroku-buildpack-ruby/cedar-14/ruby-2.1.1.tgz -s -o - | tar zxf - ' failed unexpectedly:
    remote: !
    remote: ! gzip: stdin: unexpected end of file
    remote: ! tar: Child returned status 1
    remote: ! tar: Error is not recoverable: exiting now
    remote: !
    remote:
    remote: ! Push rejected, failed to compile Ruby app
    remote:
    remote: Verifying deploy....
    remote:
    remote: ! Push rejected to quiet-springs-8925.
    remote:
    To https://git.heroku.com/quiet-springs-8925.git
    ! [remote rejected] master -> master (pre-receive hook declined)
    error: failed to push some refs to 'https://git.heroku.com/quiet-springs-8925.git'

    gem 文件:
    source 'https://rubygems.org'


    # Bundle edge Rails instead: gem 'rails', github: 'rails/rails'
    ruby '2.0.0'
    gem 'rails', '4.1.5'
    gem 'bcrypt', '3.1.7'
    # Use sqlite3 as the database for Active Record
    gem 'sqlite3'
    # Use SCSS for stylesheets
    gem 'sass-rails', '~> 4.0.3'
    # Use Uglifier as compressor for JavaScript assets
    gem 'uglifier', '>= 1.3.0'
    # Use CoffeeScript for .js.coffee assets and views
    gem 'coffee-rails', '~> 4.0.0'
    # See https://github.com/sstephenson/execjs#readme for more supported runtimes
    # gem 'therubyracer', platforms: :ruby

    # Use jquery as the JavaScript library
    gem 'jquery-rails'
    # Turbolinks makes following links in your web application faster. Read more: https://github.com/rails/turbolinks
    gem 'turbolinks'
    # Build JSON APIs with ease. Read more: https://github.com/rails/jbuilder
    gem 'jbuilder', '~> 2.0'
    # bundle exec rake doc:rails generates the API under doc/api.
    gem 'sdoc', '~> 0.4.0', group: :doc

    # Spring speeds up development by keeping your application running in the background. Read more: https://github.com/rails/spring
    gem 'spring', group: :development

    group :test do
    gem 'minitest-reporters', '1.0.5'
    gem 'mini_backtrace', '0.1.3'
    gem 'guard-minitest', '2.3.1'
    end

    group :production do
    gem 'pg', '0.17.1'
    gem 'rails_12factor', '0.0.2'
    gem 'puma', '2.11.1'
    end
    # Use ActiveModel has_secure_password
    # gem 'bcrypt', '~> 3.1.7'

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

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

    # Use debugger
    # gem 'debugger', group: [:development, :test]

    最佳答案

    Heroku 不支持 Ruby 2.1.1。就像错误中所说的那样,您可以找到哪些 ruby​​ 运行时有效 here .

    快速查看可用的 Ruby 运行时:1.8.7、1.9.2、1.9.3、2.0.0、2.1.6、2.2.2。

    关于ruby-on-rails - 无法将 Rails 应用程序部署到 Heroku,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/31438194/

    25 4 0
    Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
    广告合作:1813099741@qq.com 6ren.com