为什么Heroku说“出了问题”?

时间:2013-07-17 08:12:55

标签: ruby-on-rails heroku

我已经检查过每一篇关于此的帖子,但它似乎没有解决我的问题.. 这就是我试过的

config.assets.compile = false中将true更改为environment/production因为它可能是编译中的问题(参考此Heroku — "We're sorry, but something went wrong"

heroku run rake db:migrate ..在大多数情况下似乎是解决方案,但问题是我没有数据库..它显示了这个结果

Running `rake db:migrate` attached to terminal... up, run.3272
DEPRECATION WARNING: You have Rails 2.3-style plugins in vendor/plugins! Support for these plugins will be removed in Rails 4.0. Move them out and bu
 them in to your app as lib/myplugin/* and config/initializers/myplugin.rb. See the release notes for more on this: http://weblog.rubyonrails.org/201
eased. (called from <top (required)> at /app/Rakefile:7)
DEPRECATION WARNING: You have Rails 2.3-style plugins in vendor/plugins! Support for these plugins will be removed in Rails 4.0. Move them out and bu
 them in to your app as lib/myplugin/* and config/initializers/myplugin.rb. See the release notes for more on this: http://weblog.rubyonrails.org/201
eased. (called from <top (required)> at /app/Rakefile:7)
DEPRECATION WARNING: You have Rails 2.3-style plugins in vendor/plugins! Support for these plugins will be removed in Rails 4.0. Move them out and bu
 them in to your app as lib/myplugin/* and config/initializers/myplugin.rb. See the release notes for more on this: http://weblog.rubyonrails.org/201

甚至heroku logs都有此弃用警告

←[36m2013-07-17T07:45:32.553996+00:00 heroku[web.1]:←[0m Starting process with command `bundle exec thin start -R config.ru -e $RAILS_ENV -p 20199`
←[36m2013-07-17T07:45:34.178981+00:00 heroku[web.1]:←[0m Stopping all processes with SIGTERM
←[36m2013-07-17T07:45:35.587040+00:00 app[web.1]:←[0m DEPRECATION WARNING: You have Rails 2.3-style plugins in vendor/plugins! Support for these plug
Move them out and bundle them in your Gemfile, or fold them in to your app as lib/myplugin/* and config/initializers/myplugin.rb. See the release not
.rubyonrails.org/2012/1/4/rails-3-2-0-rc2-has-been-released. (called from <top (required)> at /app/config/environment.rb:5)
←[36m2013-07-17T07:45:35.587536+00:00 app[web.1]:←[0m DEPRECATION WARNING: You have Rails 2.3-style plugins in vendor/plugins! Support for these plug
Move them out and bundle them in your Gemfile, or fold them in to your app as lib/myplugin/* and config/initializers/myplugin.rb. See the release not
.rubyonrails.org/2012/1/4/rails-3-2-0-rc2-has-been-released. (called from <top (required)> at /app/config/environment.rb:5)
←[36m2013-07-17T07:45:35.586908+00:00 app[web.1]:←[0m DEPRECATION WARNING: You have Rails 2.3-style plugins in vendor/plugins! Support for these plug
Move them out and bundle them in your Gemfile, or fold them in to your app as lib/myplugin/* and config/initializers/myplugin.rb. See the release not
.rubyonrails.org/2012/1/4/rails-3-2-0-rc2-has-been-released. (called from <top (required)> at /app/config/environment.rb:5)
←[36m2013-07-17T07:45:36.183427+00:00 heroku[web.1]:←[0m Process exited with status 0
←[36m2013-07-17T07:45:37.602911+00:00 app[web.1]:←[0m >> Listening on 0.0.0.0:20199, CTRL+C to stop
←[36m2013-07-17T07:45:37.602821+00:00 app[web.1]:←[0m >> Maximum connections set to 1024
←[36m2013-07-17T07:45:37.602821+00:00 app[web.1]:←[0m >> Thin web server (v1.5.1 codename Straight Razor)
←[36m2013-07-17T07:45:37.750492+00:00 heroku[web.1]:←[0m State changed from starting to up
←[36m2013-07-17T07:45:38.863569+00:00 app[web.1]:←[0m Started GET "/" for 180.194.29.171 at 2013-07-17 07:45:38 +0000
←[36m2013-07-17T07:45:39.426857+00:00 app[web.1]:←[0m Connecting to database specified by DATABASE_URL
←[36m2013-07-17T07:45:39.646018+00:00 app[web.1]:←[0m Processing by WelcomeController#index as HTML
←[36m2013-07-17T07:45:39.950625+00:00 app[web.1]:←[0m   Rendered welcome/index.html.erb within layouts/application (275.2ms)

这是剩下的日志:

←[35m2013-07-17T07:36:43.950427+00:00 heroku[run.3272]:←[0m State changed from up to complete
←[35m2013-07-17T07:36:43.928758+00:00 heroku[run.3272]:←[0m Process exited with status 0
←[36m2013-07-17T07:38:16.891236+00:00 app[web.1]:←[0m     2: <head>
←[36m2013-07-17T07:38:16.891236+00:00 app[web.1]:←[0m     5:   <%= javascript_include_tag "welcome" %>
←[36m2013-07-17T07:38:16.891236+00:00 app[web.1]:←[0m   (in /app/app/assets/javascripts/welcome.js)):
←[36m2013-07-17T07:38:16.884008+00:00 app[web.1]:←[0m Processing by WelcomeController#index as HTML
←[36m2013-07-17T07:38:16.891236+00:00 app[web.1]:←[0m     8: </head>
←[36m2013-07-17T07:38:16.891422+00:00 app[web.1]:←[0m   app/views/welcome/index.html.erb:5:in `_app_views_welcome_index_html_erb___350577225301439618
←[36m2013-07-17T07:38:16.887951+00:00 app[web.1]:←[0m   Rendered welcome/index.html.erb within layouts/application (2.9ms)
←[36m2013-07-17T07:38:16.891236+00:00 app[web.1]:←[0m     6:   <%= javascript_include_tag "connectFour" %>
←[36m2013-07-17T07:38:16.880639+00:00 app[web.1]:←[0m Started GET "/" for 180.194.29.171 at 2013-07-17 07:38:16 +0000
←[36m2013-07-17T07:38:16.891236+00:00 app[web.1]:←[0m     3:   <title>ConnectFour</title>
←[36m2013-07-17T07:38:16.888300+00:00 app[web.1]:←[0m Completed 500 Internal Server Error in 4ms
←[36m2013-07-17T07:38:16.891236+00:00 app[web.1]:←[0m
←[36m2013-07-17T07:38:16.891236+00:00 app[web.1]:←[0m ActionView::Template::Error (cannot load such file -- uglifier
←[36m2013-07-17T07:38:16.891236+00:00 app[web.1]:←[0m     7:   <%= csrf_meta_tags %>
←[36m2013-07-17T07:38:16.891236+00:00 app[web.1]:←[0m     4:   <%= stylesheet_link_tag    "application", :media => "all" %>
←[36m2013-07-17T07:38:16.891422+00:00 app[web.1]:←[0m
←[36m2013-07-17T07:38:16.891422+00:00 app[web.1]:←[0m
←[33m2013-07-17T07:38:16.889783+00:00 heroku[router]:←[0m at=info method=GET path=/ host=dry-tundra-9704.herokuapp.com fwd="180.194.29.171" dyno=web.
500 bytes=643
←[33m2013-07-17T07:38:18.527722+00:00 heroku[router]:←[0m at=info method=GET path=/favicon.ico host=dry-tundra-9704.herokuapp.com fwd="180.194.29.171
ms status=200 bytes=0
←[36m2013-07-17T07:40:59.052597+00:00 app[web.1]:←[0m Started GET "/" for 180.194.29.171 at 2013-07-17 07:40:59 +0000
←[36m2013-07-17T07:40:59.057092+00:00 app[web.1]:←[0m Processing by WelcomeController#index as HTML
←[36m2013-07-17T07:40:59.060778+00:00 app[web.1]:←[0m   Rendered welcome/index.html.erb within layouts/application (3.1ms)
←[36m2013-07-17T07:40:59.060858+00:00 app[web.1]:←[0m Completed 500 Internal Server Error in 4ms
←[36m2013-07-17T07:40:59.066089+00:00 app[web.1]:←[0m
←[36m2013-07-17T07:40:59.066089+00:00 app[web.1]:←[0m   (in /app/app/assets/javascripts/welcome.js)):
←[36m2013-07-17T07:40:59.066089+00:00 app[web.1]:←[0m ActionView::Template::Error (cannot load such file -- uglifier
←[36m2013-07-17T07:40:59.066252+00:00 app[web.1]:←[0m
←[36m2013-07-17T07:40:59.066089+00:00 app[web.1]:←[0m     4:   <%= stylesheet_link_tag    "application", :media => "all" %>
←[36m2013-07-17T07:40:59.066089+00:00 app[web.1]:←[0m     2: <head>
←[36m2013-07-17T07:40:59.066252+00:00 app[web.1]:←[0m
←[36m2013-07-17T07:40:59.066089+00:00 app[web.1]:←[0m     8: </head>
←[36m2013-07-17T07:40:59.066089+00:00 app[web.1]:←[0m     3:   <title>ConnectFour</title>
←[36m2013-07-17T07:40:59.066089+00:00 app[web.1]:←[0m     5:   <%= javascript_include_tag "welcome" %>
←[36m2013-07-17T07:40:59.066252+00:00 app[web.1]:←[0m   app/views/welcome/index.html.erb:5:in `_app_views_welcome_index_html_erb___350577225301439618
←[36m2013-07-17T07:40:59.066089+00:00 app[web.1]:←[0m     6:   <%= javascript_include_tag "connectFour" %>
←[36m2013-07-17T07:40:59.066089+00:00 app[web.1]:←[0m     7:   <%= csrf_meta_tags %>
←[33m2013-07-17T07:40:59.070059+00:00 heroku[router]:←[0m at=info method=GET path=/ host=dry-tundra-9704.herokuapp.com fwd="180.194.29.171" dyno=web.
500 bytes=643
←[33m2013-07-17T07:41:00.133064+00:00 heroku[router]:←[0m at=info method=GET path=/favicon.ico host=dry-tundra-9704.herokuapp.com fwd="180.194.29.171
ms status=200 bytes=0
2013-07-17T07:44:51+00:00 heroku[slug-compiler]: Slug compilation started
←[36m2013-07-17T07:45:30.985926+00:00 heroku[web.1]:←[0m State changed from up to starting
2013-07-17T07:45:31+00:00 heroku[slug-compiler]: Slug compilation finished
←[36m2013-07-17T07:45:32.553996+00:00 heroku[web.1]:←[0m Starting process with command `bundle exec thin start -R config.ru -e $RAILS_ENV -p 20199`
←[36m2013-07-17T07:45:34.178981+00:00 heroku[web.1]:←[0m Stopping all processes with SIGTERM
[36m2013-07-17T07:45:36.183427+00:00 heroku[web.1]:←[0m Process exited with status 0
←[36m2013-07-17T07:45:37.602911+00:00 app[web.1]:←[0m >> Listening on 0.0.0.0:20199, CTRL+C to stop                                Server Error in 305ms
←[36m2013-07-17T07:45:37.602821+00:00 app[web.1]:←[0m >> Maximum connections set to 1024                                             ←[36m2013-07-17T07:45:39.953217+00:00 app[web.1]:←
←[36m2013-07-17T07:45:37.602821+00:00 app[web.1]:←[0m >> Thin web server (v1.5.1 codename Straight Razor)                          [0m     2: <head>
←[36m2013-07-17T07:45:37.750492+00:00 heroku[web.1]:←[0m State changed from starting to up                                                                      ←[36m2013-07-17T07:45:3
←[36m2013-07-17T07:45:38.863569+00:00 app[web.1]:←[0m Started GET "/" for 180.194.29.171 at 2013-07-17 07:45:38 +0000              9.953395+00:00 app[web.1]:←[0m   app/views/welcome/i
←[36m2013-07-17T07:45:39.426857+00:00 app[web.1]:←[0m Connecting to database specified by DATABASE_URL
←[36m2013-07-17T07:45:39.646018+00:00 app[web.1]:←[0m Processing by WelcomeController#index as HTML                                    ←[36m2013-07-17T07:45:39.953217+00:00 app[web.1]
←[36m2013-07-17T07:45:39.950625+00:00 app[web.1]:←[0m   Rendered welcome/index.html.erb within layouts/application (275.2ms)       :←[0m     6:   <%= javascript_include_tag "connectFo
←[36m2013-07-17T07:45:39.953217+00:00 app[web.1]:←[0m ActionView::Template::Error (cannot load such file -- uglifier                                              ←[33m2013-07-17T07:45
←[36m2013-07-17T07:45:39.953217+00:00 app[web.1]:←[0m     3:   <title>ConnectFour</title>                                          0
←[33m2013-07-17T07:45:39.954812+00:00 heroku[router]:←[0m at=info method=GET path=/ host=dry-tundra-9704.herokuapp.com fwd="180.194
s=500 bytes=643
←[36m2013-07-17T07:45:39.950710+00:00 app[web.1]:←[0m Completed 500 Internal Server Error in 305ms
←[36m2013-07-17T07:45:39.953217+00:00 app[web.1]:←[0m
←[36m2013-07-17T07:45:39.953217+00:00 app[web.1]:←[0m   (in /app/app/assets/javascripts/welcome.js)):
←[36m2013-07-17T07:45:39.953217+00:00 app[web.1]:←[0m     2: <head>
←[36m2013-07-17T07:45:39.953395+00:00 app[web.1]:←[0m
←[36m2013-07-17T07:45:39.953217+00:00 app[web.1]:←[0m     4:   <%= stylesheet_link_tag    "application", :media => "all" %>
←[36m2013-07-17T07:45:39.953395+00:00 app[web.1]:←[0m   app/views/welcome/index.html.erb:5:in `_app_views_welcome_index_html_erb__1768954839152578095
←[36m2013-07-17T07:45:39.953395+00:00 app[web.1]:←[0m
←[36m2013-07-17T07:45:39.953217+00:00 app[web.1]:←[0m     8: </head>
←[36m2013-07-17T07:45:39.953217+00:00 app[web.1]:←[0m     5:   <%= javascript_include_tag "welcome" %>
←[36m2013-07-17T07:45:39.953217+00:00 app[web.1]:←[0m     6:   <%= javascript_include_tag "connectFour" %>
←[36m2013-07-17T07:45:39.953217+00:00 app[web.1]:←[0m     7:   <%= csrf_meta_tags %>
←[33m2013-07-17T07:45:41.221022+00:00 heroku[router]:←[0m at=info method=GET path=/favicon.ico host=dry-tundra-9704.herokuapp.com fwd="180.194.29.171

我认为我的Gemfile在这里可以:

source 'https://rubygems.org'

ruby '1.9.3'

gem 'rails', '3.2.13'
group :development do
  gem 'sqlite3'
end

group :production do
  gem 'thin'
  gem 'pg'
end

还有这个

-----> WARNINGS:
       Removing `Gemfile.lock` because it was generated on Windows.
       Bundler will do a full resolve so native gems are handled properly.
       This may result in unexpected gem versions being used in your app.

每当我部署我的应用程序时,这个东西就出现了。我在重写Gemfile之前删除了这个文件,但是当我在应用程序中部署它时它就生成了。

可能导致什么原因?

2 个答案:

答案 0 :(得分:1)

你的heroku错误是

ActionView::Template::Error (cannot load such file -- uglifier

请添加宝石

  gem 'uglifier'  

在Gemfile中

2)然后在本地

中运行bundle install

3)然后git add,git commit,git push heroku

答案 1 :(得分:1)

你缺少uglifier gem。你需要添加它并推送到heroku

group :assets do
  gem 'uglifier'
end