簡體   English   中英

無法將Rails應用程序部署到Heroku

[英]Having Trouble to deploy a Rails App to Heroku

我在向Heroku部署rails應用程序時遇到了麻煩。 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'添加到App的Gemfile中

  • 我確實運行了bundle install (No Error Messages)
  • 我確實運行了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'

Gemfile:

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運行時工作。

快速查看有效的Ruby運行時:1.8.7,1.9.2,1.9.3,2.0.0,2.1.6,2.2.2。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM