2012-07-05 83 views
12

所以我的应用程序运行完全在我的本地机器上,我推它成功的GitHub和Heroku的,但是当我尝试在我的浏览器中打开应用程序时,我收到以下错误:“捆绑:找不到命令:瘦” Heroku的部署轨

Application Error 
An error occurred in the application and your page could not be served. Please try again in a few moments. 

If you are the application owner, check your logs for details. 

然后我尝试运行

$ heroku logs 

而且我得到了我的控制台输出如下:

2012-07-05T21:52:11+00:00 heroku[slugc]: Slug compilation started 
2012-07-05T21:52:33+00:00 heroku[slugc]: Slug compilation failed: failed to compile Ruby/rails app 
2012-07-05T21:53:33+00:00 heroku[slugc]: Slug compilation started 
2012-07-05T21:53:55+00:00 heroku[slugc]: Slug compilation failed: failed to compile Ruby/rails app 
2012-07-05T21:58:45+00:00 heroku[slugc]: Slug compilation started 
2012-07-05T21:59:04+00:00 heroku[slugc]: Slug compilation failed: failed to compile Ruby/rails app 
2012-07-05T22:00:34+00:00 heroku[slugc]: Slug compilation started 
2012-07-05T22:01:21+00:00 heroku[api]: Add shared-database:5mb add-on by [email protected] 
2012-07-05T22:01:21+00:00 heroku[api]: Release v2 created by [email protected] 
2012-07-05T22:01:21+00:00 heroku[api]: Add RAILS_ENV, LANG, PATH, RACK_ENV, GEM_PATH config by [email protected] 
2012-07-05T22:01:21+00:00 heroku[api]: Release v3 created by [email protected] 
2012-07-05T22:01:23+00:00 heroku[api]: Release v4 created by [email protected] 
2012-07-05T22:01:23+00:00 heroku[api]: Deploy 23effb5 by [email protected] 
2012-07-05T22:01:24+00:00 heroku[slugc]: Slug compilation finished 
2012-07-05T22:01:27+00:00 heroku[web.1]: Starting process with command `bundle exec thin start -R config.ru -e production -p 4606` 
2012-07-05T22:01:30+00:00 app[web.1]: bundler: command not found: thin 
2012-07-05T22:01:30+00:00 app[web.1]: Install missing gem executables with `bundle install` 
2012-07-05T22:01:31+00:00 heroku[web.1]: Process exited with status 127 
2012-07-05T22:01:31+00:00 heroku[web.1]: State changed from starting to crashed 
2012-07-05T22:01:31+00:00 heroku[web.1]: State changed from crashed to starting 
2012-07-05T22:01:34+00:00 heroku[web.1]: Starting process with command `bundle exec thin start -R config.ru -e production -p 16779` 
2012-07-05T22:01:35+00:00 app[web.1]: bundler: command not found: thin 
2012-07-05T22:01:35+00:00 app[web.1]: Install missing gem executables with `bundle install` 
2012-07-05T22:01:36+00:00 heroku[web.1]: Process exited with status 127 
2012-07-05T22:01:36+00:00 heroku[web.1]: State changed from starting to crashed 
2012-07-05T22:01:37+00:00 heroku[router]: Error H10 (App crashed) -> GET glowing-robot-9319.herokuapp.com/ dyno= queue= wait= service= status=503 bytes= 
2012-07-05T22:01:38+00:00 heroku[router]: Error H10 (App crashed) -> GET glowing-robot-9319.herokuapp.com/favicon.ico dyno= queue= wait= service= status=503 bytes= 
2012-07-05T22:01:49+00:00 heroku[router]: Error H10 (App crashed) -> GET glowing-robot-9319.herokuapp.com/ dyno= queue= wait= service= status=503 bytes= 
2012-07-05T22:01:49+00:00 heroku[router]: Error H10 (App crashed) -> GET glowing-robot-9319.herokuapp.com/favicon.ico dyno= queue= wait= service= status=503 bytes= 
2012-07-05T22:01:50+00:00 heroku[router]: Error H10 (App crashed) -> GET glowing-robot-9319.herokuapp.com/ dyno= queue= wait= service= status=503 bytes= 
2012-07-05T22:01:51+00:00 heroku[router]: Error H10 (App crashed) -> GET glowing-robot-9319.herokuapp.com/favicon.ico dyno= queue= wait= service= status=503 bytes= 
2012-07-05T22:01:51+00:00 heroku[router]: Error H10 (App crashed) -> GET glowing-robot-9319.herokuapp.com/ dyno= queue= wait= service= status=503 bytes= 
2012-07-05T22:01:51+00:00 heroku[router]: Error H10 (App crashed) -> GET glowing-robot-9319.herokuapp.com/favicon.ico dyno= queue= wait= service= status=503 bytes= 

我找不出本作的是什么,因为这是我第一次部署到Heroku的,我不知道网络部署的任何东西。任何帮助将不胜感激!

+0

将'gem'pg' gem'taps''添加到** Gemfile **和bundle install。并将其部署到heroku并重新启动服务器。 – 2012-07-06 05:19:52

回答

2

你可能丢失你的Gemfile中的瑰宝。确保您的应用程序需要的所有内容都在Gemfile中指定,而不是在本地执行“gem install”。为了验证,你可以安装RVM,专门创建一个宝石为您的应用程序,运行“安装捆绑”在你的应用程序目录,然后看看你的应用程序在本地运行。如果它不运行,一个宝石肯定会丢失。

21

对我来说,问题是我在开发部分添加了瘦我的Gemfile,但是一旦我做了,那么heroku想用它来生产,但不会在开发部分安装宝石。通过移动薄宝石出来供所有环境中使用开发部分的,我能闯过此错误。

你的Gemfile可能会是这个样子的Rails应用程序:

source 'https://rubygems.org' 

gem 'rails' 
gem 'heroku' 

# Bundle edge Rails instead: 
# gem 'rails', :git => 'git://github.com/rails/rails.git' 

gem 'pg' 
gem 'thin' 

# more gems 

的Heroku recommends thin用于生产Web服务器反正。

更新(2012-05-16):在该现在的Rails以上recommends unicorn的Heroku 3的网络服务器的链接。薄将仍然工作,但你可能要考虑switching over to unicorn

+0

感谢您的提示! – wikichen 2013-04-06 07:29:51

1

看来,heroku正试图在没有Procfile的情况下启动Thin来告诉它。如上所述,Thin没有安装在Gemfile中,因此出现错误。如上所述,从开发小组中脱身是行得通的。

如果你想获得的Heroku开始独角兽,而不是薄,设置你的config/unicorn.rb和你Procfile如下所示:https://devcenter.heroku.com/articles/rails-unicorn

为麒麟Procfile内容中的链接上面列出的,并有关Procfile的更多信息(只是一个名为'Procfile'的文件在你的应用程序的根目录中):https://devcenter.heroku.com/articles/procfile