简单的 Heroku + Rails 4 应用程序崩溃 [英] simple Heroku + Rails 4 app crashing

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

问题描述

我在 Hartl's 的第 2 章末尾Rails 教程该应用程序可以在本地运行,但我无法部署它.

I am at the end of Chapter 2 of Hartl's Rails Tutorial the app works locally but I can't get it to deploy.

http://quiet-ocean-3277.herokuapp.com/

$ git push heroku master
Counting objects: 3, done.
Delta compression using up to 2 threads.
Compressing objects: 100% (2/2), done.
Writing objects: 100% (2/2), 253 bytes, done.
Total 2 (delta 1), reused 0 (delta 0)

-----> Ruby/Rails app detected
-----> Using Ruby version: ruby-1.9.3
-----> Installing dependencies using Bundler version 1.3.2
       Running: bundle install --without development:test --path vendor/bundle --binstubs vendor/bundle/bin --deployment
       Using rake (10.1.0)
       Using i18n (0.6.4)
       Using minitest (4.7.5)
       Using multi_json (1.7.7)
       Using atomic (1.1.10)
       Using thread_safe (0.1.0)
       Using tzinfo (0.3.37)
       Using activesupport (4.0.0)
       Using builder (3.1.4)
       Using erubis (2.7.0)
       Using rack (1.5.2)
       Using rack-test (0.6.2)
       Using actionpack (4.0.0)
       Using mime-types (1.23)
       Using polyglot (0.3.3)
       Using treetop (1.4.14)
       Using mail (2.5.4)
       Using actionmailer (4.0.0)
       Using activemodel (4.0.0)
       Using activerecord-deprecated_finders (1.0.3)
       Using arel (4.0.0)
       Using activerecord (4.0.0)
       Using coffee-script-source (1.6.3)
       Using execjs (1.4.0)
       Using coffee-script (2.2.0)
       Using thor (0.18.1)
       Using railties (4.0.0)
       Using coffee-rails (4.0.0)
       Using hike (1.2.3)
       Using jbuilder (1.0.2)
       Using jquery-rails (2.2.1)
       Using json (1.8.0)
       Using pg (0.15.1)
       Using bundler (1.3.2)
       Using tilt (1.4.1)
       Using sprockets (2.10.0)
       Using sprockets-rails (2.0.0)
       Using rails (4.0.0)
       Using rails_serve_static_assets (0.0.1)
       Using rails_stdout_logging (0.0.1)
       Using rails_12factor (0.0.2)
       Using rdoc (3.12.2)
       Using sass (3.2.9)
       Using sass-rails (4.0.0)
       Using sdoc (0.3.20)
       Using turbolinks (1.1.1)
       Using uglifier (2.1.1)
       Your bundle is complete! It was installed into ./vendor/bundle
       Cleaning up the bundler cache.
-----> Writing config/database.yml to read from DATABASE_URL
-----> Preparing app for Rails asset pipeline
       Running: rake assets:precompile
       Asset precompilation completed (7.52s)
       Cleaning assets
-----> WARNINGS:
       You have not declared a Ruby version in your Gemfile.
       To set your Ruby version add this line to your Gemfile:
       ruby '1.9.3'
       # See https://devcenter.heroku.com/articles/ruby-versions for more information."
-----> Discovering process types
       Procfile declares types      -> (none)
       Default types for Ruby/Rails -> console, rake, web, worker

-----> Compiled slug size: 20.0MB
-----> Launching... done, v8
       http://quiet-ocean-3277.herokuapp.com deployed to Heroku

To git@heroku.com:quiet-ocean-3277.git
   2d25f33..322b9e4  master -> master

除了应用程序崩溃外,一切看起来都很好.在日志中:

All looks good except the app crashes. In the logs:

2013-07-17T23:56:21.430674+00:00 heroku[web.1]: State changed from starting to crashed
2013-07-18T00:00:36.148404+00:00 heroku[web.1]: State changed from crashed to starting
2013-07-18T00:00:39.933663+00:00 heroku[web.1]: Starting process with command `bin/rails server -p 40617 -e $RAILS_ENV`
2013-07-18T00:00:41.477904+00:00 app[web.1]: /usr/bin/env: ruby1.9.1: No such file or directory
2013-07-18T00:00:42.674144+00:00 heroku[web.1]: Process exited with status 127

为什么它会调用 Ruby 1.9.1 并崩溃? 这是 gemfile:

Why is it calling Ruby 1.9.1 and crashing ? Here's the gemfile:

source 'https://rubygems.org'
#ruby '1.9.3'
#ruby-gemset=railstutorial_rails_4_0

gem 'rails', '4.0.0'

group :development do
  gem 'sqlite3', '1.3.7'
end

gem 'sass-rails', '4.0.0'
gem 'uglifier', '2.1.1'
gem 'coffee-rails', '4.0.0'
gem 'jquery-rails', '2.2.1'
gem 'turbolinks', '1.1.1'
gem 'jbuilder', '1.0.2'

group :doc do
  gem 'sdoc', '0.3.20', require: false
end

group :production do
  gem 'pg', '0.15.1'
  gem 'rails_12factor', '0.0.2'
end

推荐答案

我遇到了同样的问题.我通过在 3 个文件中替换 "#!/usr/bin/env ruby​​1.9.1" => "#!/usr/bin/env ruby​​" 解决了这个问题:

I had same problem. I solved it by repacement "#!/usr/bin/env ruby1.9.1" => "#!/usr/bin/env ruby" in 3 files:

  • bin/bundle
  • 垃圾箱/导轨
  • 垃圾桶/耙

这篇关于简单的 Heroku + Rails 4 应用程序崩溃的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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