无法在Heroku上部署Rails应用程序 [英] Having Trouble to deploy a Rails App to Heroku

查看:95
本文介绍了无法在Heroku上部署Rails应用程序的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在将Rails应用程序部署到Heroku时遇到了麻烦. Heroku给我错误消息An error occurred while installing Ruby ruby-2.1.1,这使我在将所有内容都设置为ruby 2.0.0时都感到困惑. 有任何想法吗?谢谢!

I'm having trouble to deploy a rails app to Heroku. Heroku is giving me the Error Message An error occurred while installing Ruby ruby-2.1.1 which is confusing me after all that I've done to set everything to ruby 2.0.0. Any Ideas? Thanks!

到目前为止的步骤:

  • I searched here https://devcenter.heroku.com/articles/ruby-support#supported-runtimes for a ruby version that is currently compatible.
  • I Installed the Version Ruby 2.0.0 via RVM on my Computer
  • I made sure that this version is used: rvm use ruby-2.0.0

我在应用程序的Gemfile中添加了ruby'2.0.0'行

I added the line ruby '2.0.0' to the App's Gemfile

Heroku错误消息:

The Heroku Errormessage:

   > ~/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.2.1.就像错误中所说的那样,您可以在此处找到工作的红宝石运行时.

Heroku doesn't support Ruby 2.1.1. Like it says in the errors, you can find which ruby runtimes work here.

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

Quick look at the Ruby runtimes that work gives: 1.8.7, 1.9.2, 1.9.3, 2.0.0, 2.1.6, 2.2.2.

这篇关于无法在Heroku上部署Rails应用程序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆