【问题标题】:Why does Heroku says "something went wrong"?为什么 Heroku 说“出了点问题”?
【发布时间】:2014-11-14 14:41:56
【问题描述】:

我已经检查了所有关于此的帖子,但它似乎并没有解决我的问题.. 这是我尝试过的

environment/production 中的config.assets.compile = false 更改为true,因为这可能是编译中的问题(参考此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 之前删除了这个文件,但我猜它是在我将它部署到应用程序时生成的..

可能是什么原因造成的?

【问题讨论】:

  • 您的日志显示它没有找到 uglifier gem。你在 GemFile 中添加了这个吗?如果没有,则添加 group :assets do gem 'uglifier' end ,然后推送到 heroku。
  • 就是这样,非常感谢!因此,如果缺少 gem,我只需将其添加到 Gemfile 中?
  • 是的。没关系。请参阅下面的答案。

标签: ruby-on-rails heroku


【解决方案1】:

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

group :assets do
  gem 'uglifier'
end 

【讨论】:

    【解决方案2】:

    你的heroku错误是

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

    请添加宝石

      gem 'uglifier'  
    

    在 Gemfile 中

    2) 然后在本地运行 bundle install

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

    【讨论】:

      猜你喜欢
      • 2020-08-06
      • 2014-01-22
      • 2012-05-09
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2013-08-12
      • 1970-01-01
      相关资源
      最近更新 更多