当前位置: 首页 > 知识库问答 >
问题:

Rails Heroku应用程序无法加载

强保臣
2023-03-14

部署在Heroku上的Rails应用程序无法加载。我设置了数据库迁移,我还有puma和procfile。。。我真的不知道。

这是我的日志:

2016-06-27T02:12:40.565429+00:00 heroku[web.1]: Starting process with    command `bin/rails server -p 8592 -e production`
2016-06-27T02:12:43.410912+00:00 app[web.1]: => Ctrl-C to shutdown server
2016-06-27T02:12:43.410821+00:00 app[web.1]: => Booting Puma
2016-06-27T02:12:43.410885+00:00 app[web.1]: => Rails 4.2.6 application starting in production on http://127.0.0.1:8592
2016-06-27T02:12:43.410896+00:00 app[web.1]: => Run `rails server -h` for more startup options
2016-06-27T02:12:44.269805+00:00 app[web.1]: [3] * Version 3.4.0 (ruby 2.2.4-p230), codename: Owl Bowl Brawl
2016-06-27T02:12:44.270470+00:00 app[web.1]: [3] Use Ctrl-C to stop
2016-06-27T02:12:44.269782+00:00 app[web.1]: [3] Puma starting in cluster mode...
2016-06-27T02:12:44.269807+00:00 app[web.1]: [3] * Environment: production
2016-06-27T02:12:44.269855+00:00 app[web.1]: [3] * Preloading application
2016-06-27T02:12:44.269806+00:00 app[web.1]: [3] * Min threads: 5, max threads: 5
2016-06-27T02:12:44.269840+00:00 app[web.1]: [3] * Process workers: 2
2016-06-27T02:12:44.270026+00:00 app[web.1]: [3] * Listening on tcp://127.0.0.1:8592
2016-06-27T02:12:44.276018+00:00 app[web.1]: [3] - Worker 1 (pid: 9) booted, phase: 0
2016-06-27T02:12:44.275358+00:00 app[web.1]: [3] - Worker 0 (pid: 5) booted, phase: 0
2016-06-27T02:13:12.887521+00:00 heroku[router]: at=error code=H20 desc="App boot timeout" method=GET path="/" host=salty-sierra-72006.herokuapp.com request_id=e96197b0-0946-4b58-a68c-b8a9a3c3fc15 fwd="184.160.104.208" dyno= connect= service= status=503 bytes=
2016-06-27T02:13:41.028910+00:00 heroku[web.1]: Error R10 (Boot timeout) -> Web process failed to bind to $PORT within 60 seconds of launch
2016-06-27T02:13:41.028910+00:00 heroku[web.1]: Stopping process with SIGKILL
2016-06-27T02:13:41.783167+00:00 heroku[web.1]: State changed from starting to crashed
2016-06-27T02:13:41.772079+00:00 heroku[web.1]: Process exited with status 137
2016-06-27T02:13:42.941344+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/" host=salty-sierra-72006.herokuapp.com request_id=0411e6f6-3dee-4d15-9bf2-8e069a20d9fb fwd="184.160.104.208" dyno= connect= service= status=503 bytes=
2016-06-27T02:13:43.295246+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/favicon.ico" host=salty-sierra-72006.herokuapp.com request_id=e1d9e2cd-086a-4d65-9100-dc4c407c9835 fwd="184.160.104.208" dyno= connect= service= status=503 bytes=

宝石文件

source 'https://rubygems.org'


gem 'rails', '4.2.6'
gem 'pg'
gem 'uglifier', '>= 1.3.0'
gem 'coffee-rails', '~> 4.1.0'
gem 'rake', '< 11'
gem 'jquery-rails'
gem 'turbolinks'
gem 'jbuilder', '~> 2.0'
gem 'sdoc', '~> 0.4.0', group: :doc
gem 'rails_12factor'
gem 'bootstrap-sass', '~> 3.3.6'
gem 'sass-rails', '>= 3.2'
gem 'simple_form'

gem 'twilio-ruby', '~> 4.11.1'
gem 'dotenv-rails'
gem 'puma'
gem "font-awesome-rails"

group :development, :test do
  gem 'rspec-rails', '~> 3.1.0'
  gem "factory_girl_rails",   "~> 4.7.0"
  gem "faker"
  gem "shoulda-matchers",     "~> 3.1.1"
  gem "database_cleaner",     "~> 1.4.0"
  gem "rails_best_practices", "~> 1.16.0"
  gem "rails-erd"
  gem 'annotate'
  gem 'pry-byebug'
  gem 'awesome_print'
  gem 'pry-stack_explorer'
  gem 'pry-coolline'
  gem 'pry-doc'
  gem 'pry-rails'
  gem 'pry'
  gem 'pry-macro'
  gem 'pry-state'
end

group :development do
  gem 'better_errors'
  gem "binding_of_caller"

  gem 'spring'
end

程序文件

web: bundle exec puma -t 5:5 -p ${PORT:-3000} -e ${RACK_ENV:-development}

配置/puma.rb

工人整数(ENV['WEB_CONCURRENCY']||2)threads_count=整数(ENV['RAILS_MAX_THREADS']||5)线程threads_count,threads_count

preload_app!

rackup      DefaultRackup
port        ENV['PORT']     || 3000
environment ENV['RACK_ENV'] || 'development'

on_worker_boot do
  # Worker specific setup for Rails 4.1+
  # See: https://devcenter.heroku.com/articles/deploying-rails-applications-with-the-puma-web-server#on-worker-boot
  ActiveRecord::Base.establish_connection
end

共有1个答案

戚学文
2023-03-14

我发现问题很简单。

1-heroku pg:重置数据库\u URL

2- https://devcenter.heroku.com/articles/heroku-postgresql

3-启动Heroku从您的本地,而不是您的虚拟框。

工作

 类似资料:
  • 我已经提供了Linux SWT jar,并在Eclipse中打包了应用程序,以便在应用程序的jar中包含SWT.jar。当我尝试在Ubuntu上运行它时,我得到了以下错误文本(发布只是原因):

  • 我正在处理一个Spring Boot应用程序,其中我使用该应用程序公开SOAP WebService。我在Spring boot应用程序中使用Apache CFX framework for SOAP impl。我正在使用基于注释的方法。 我在一个bean中的Spring Boot配置文件中设置应用程序上下文时遇到了问题。下面是我的代码。 配置文件如下所示。 现在我有了bean SOAPproce

  • 问题内容: 我在下面的结构中有一个应用程序 我的内容如下 应用程序包中的内容 我以如下方式启动了 服务器成功启动,但是我在启动日志中会出错,如下所示 发布了类似的问题,但是为这些问题提供的解决方案已经在我的代码中。我无法找到为什么出现此错误。 谢谢 问题答案: “未找到可调用的问题”(我怀疑不是导入错误)。更改: 进入这个 要么

  • 在我的SpringBootWeb服务应用程序中,我想加载一个名为appName的属性,该属性的值在application.properties中定义。 application.properties具有以下条目 我通过主应用程序类启动应用程序,如下所示 但是,当我运行应用程序时,我得到以下错误 原因:java.lang.IllegalArgumentException:无法解析字符串值“${appN

  • [错误]原因:java.lang.IllegalStateException:HttpAuthenticationFactory的机制[KEYCLOAK]中没有必需的机制“Basic”。“}}}}