成功将Rails应用程序部署到Heroku构建中,但仍然存在错误

时间:2019-10-03 15:52:42

标签: ruby-on-rails heroku

我正在尝试将Rails应用程序部署到Heroku,并且构建成功,但是当我打开应用程序时显示应用程序错误。

不确定我在做什么错,我可以通过Rails服务器在本地运行它并启动它,但是在部署到Heroku时会抛出错误

好的。我更新了一些内容,当我下雨时,我得到以下内容?如果有人可以帮助。

2019-10-08T01:52:43.687425+00:00 app[api]: Initial release by user jparker010190@gmail.com
2019-10-08T01:52:44.026706+00:00 app[api]: Enable Logplex by user jparker010190@gmail.com
2019-10-08T01:52:44.026706+00:00 app[api]: Release v2 created by user jparker010190@gmail.com
2019-10-08T01:52:43.687425+00:00 app[api]: Release v1 created by user jparker010190@gmail.com
2019-10-08T01:53:36.858969+00:00 app[api]: Set RAILS_MASTER_KEY config vars by user jparker010190@gmail.com
2019-10-08T01:53:36.858969+00:00 app[api]: Release v3 created by user jparker010190@gmail.com
2019-10-08T01:53:50+00:00 app[api]: Build started by user jparker010190@gmail.com
2019-10-08T01:55:04.56063+00:00 app[api]: Set LANG, RACK_ENV, RAILS_ENV, RAILS_LOG_TO_STDOUT, RAILS_SERVE_STATIC_FILES, SECRET_KEY_BASE config vars by user jparker010190@gmail.com
2019-10-08T01:55:04.56063+00:00 app[api]: Release v4 created by user jparker010190@gmail.com
2019-10-08T01:55:08.762442+00:00 app[api]: Attach DATABASE (@ref:postgresql-parallel-30842) by user jparker010190@gmail.com
2019-10-08T01:55:08.780205+00:00 app[api]: Release v6 created by user jparker010190@gmail.com
2019-10-08T01:55:08.762442+00:00 app[api]: Running release v5 commands by user jparker010190@gmail.com
2019-10-08T01:55:08.780205+00:00 app[api]: @ref:postgresql-parallel-30842 completed provisioning, setting DATABASE_URL. by user jparker010190@gmail.com
2019-10-08T01:55:09.082862+00:00 app[api]: Release v7 created by user jparker010190@gmail.com
2019-10-08T01:55:09.098495+00:00 app[api]: Scaled to console@0:Free rake@0:Free web@1:Free by user jparker010190@gmail.com
2019-10-08T01:55:09.082862+00:00 app[api]: Deploy 695632eb by user jparker010190@gmail.com
2019-10-08T01:55:12+00:00 app[api]: Build succeeded
2019-10-08T01:55:13.770271+00:00 heroku[web.1]: Starting process with command `bin/rails server -p 36416 -e production`
2019-10-08T01:55:18.284625+00:00 heroku[web.1]: source=web.1 dyno=heroku.148880573.2937adaf-dcc2-412a-910b-76ef37afae84 sample#memory_total=87.51MB sample#memory_rss=64.64MB sample#memory_cache=22.87MB sample#memory_swap=0.00MB sample#memory_pgpgin=23091pages sample#memory_pgpgout=689pages sample#memory_quota=512.00MB
2019-10-08T01:55:19.982554+00:00 heroku[web.1]: Process exited with status 1
2019-10-08T01:55:20.040594+00:00 heroku[web.1]: State changed from starting to crashed
2019-10-08T01:55:20.044168+00:00 heroku[web.1]: State changed from crashed to starting
2019-10-08T01:55:19.912352+00:00 app[web.1]: /app/vendor/bundle/ruby/2.6.0/gems/activesupport-5.2.3/lib/active_support/message_encryptor.rb:206:in `rescue in _decrypt': ActiveSupport::MessageEncryptor::InvalidMessage (ActiveSupport::MessageEncryptor::InvalidMessage)
2019-10-08T01:55:19.912394+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.6.0/gems/activesupport-5.2.3/lib/active_support/message_encryptor.rb:183:in `_decrypt'
2019-10-08T01:55:19.912418+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.6.0/gems/activesupport-5.2.3/lib/active_support/message_encryptor.rb:157:in `decrypt_and_verify'
2019-10-08T01:55:19.91242+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.6.0/gems/activesupport-5.2.3/lib/active_support/messages/rotator.rb:21:in `decrypt_and_verify'
2019-10-08T01:55:19.912422+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.6.0/gems/activesupport-5.2.3/lib/active_support/encrypted_file.rb:79:in `decrypt'
2019-10-08T01:55:19.91243+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.6.0/gems/activesupport-5.2.3/lib/active_support/encrypted_file.rb:42:in `read'
2019-10-08T01:55:19.912432+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.6.0/gems/activesupport-5.2.3/lib/active_support/encrypted_configuration.rb:21:in `read'
2019-10-08T01:55:19.912434+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.6.0/gems/activesupport-5.2.3/lib/active_support/encrypted_configuration.rb:33:in `config'
2019-10-08T01:55:19.912436+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.6.0/gems/activesupport-5.2.3/lib/active_support/encrypted_configuration.rb:38:in `options'
2019-10-08T01:55:19.912438+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.6.0/gems/activesupport-5.2.3/lib/active_support/core_ext/module/delegation.rb:271:in `method_missing'
2019-10-08T01:55:19.912449+00:00 app[web.1]: from (erb):12:in `<main>'
2019-10-08T01:55:19.912463+00:00 app[web.1]: from /app/vendor/ruby-2.6.5/lib/ruby/2.6.0/erb.rb:901:in `eval'
2019-10-08T01:55:19.912466+00:00 app[web.1]: from /app/vendor/ruby-2.6.5/lib/ruby/2.6.0/erb.rb:901:in `result'
2019-10-08T01:55:19.912468+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.6.0/gems/activestorage-5.2.3/lib/active_storage/engine.rb:95:in `block (2 levels) in <class:Engine>'
2019-10-08T01:55:19.91247+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.6.0/gems/activesupport-5.2.3/lib/active_support/lazy_load_hooks.rb:71:in `instance_eval'
2019-10-08T01:55:19.912472+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.6.0/gems/activesupport-5.2.3/lib/active_support/lazy_load_hooks.rb:71:in `block in execute_hook'
2019-10-08T01:55:19.912474+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.6.0/gems/activesupport-5.2.3/lib/active_support/lazy_load_hooks.rb:62:in `with_execution_control'
2019-10-08T01:55:19.912476+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.6.0/gems/activesupport-5.2.3/lib/active_support/lazy_load_hooks.rb:67:in `execute_hook'
2019-10-08T01:55:19.912478+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.6.0/gems/activesupport-5.2.3/lib/active_support/lazy_load_hooks.rb:52:in `block in run_load_hooks'
2019-10-08T01:55:19.91248+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.6.0/gems/activesupport-5.2.3/lib/active_support/lazy_load_hooks.rb:51:in `each'
2019-10-08T01:55:19.912482+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.6.0/gems/activesupport-5.2.3/lib/active_support/lazy_load_hooks.rb:51:in `run_load_hooks'
2019-10-08T01:55:19.912484+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.6.0/gems/activestorage-5.2.3/app/models/active_storage/blob.rb:235:in `<class:Blob>'
2019-10-08T01:55:19.912486+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.6.0/gems/activestorage-5.2.3/app/models/active_storage/blob.rb:16:in `<main>'
2019-10-08T01:55:19.912488+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.6.0/gems/bootsnap-1.4.5/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:22:in `require'
2019-10-08T01:55:19.912495+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.6.0/gems/bootsnap-1.4.5/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:22:in `block in require_with_bootsnap_lfi'
2019-10-08T01:55:19.912498+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.6.0/gems/bootsnap-1.4.5/lib/bootsnap/load_path_cache/loaded_features_index.rb:92:in `register'
2019-10-08T01:55:19.9125+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.6.0/gems/bootsnap-1.4.5/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:21:in `require_with_bootsnap_lfi'
2019-10-08T01:55:19.912502+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.6.0/gems/bootsnap-1.4.5/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:30:in `require'
2019-10-08T01:55:19.912503+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.6.0/gems/activesupport-5.2.3/lib/active_support/dependencies.rb:291:in `block in require'
2019-10-08T01:55:19.912505+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.6.0/gems/activesupport-5.2.3/lib/active_support/dependencies.rb:257:in `load_dependency'
2019-10-08T01:55:19.912507+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.6.0/gems/activesupport-5.2.3/lib/active_support/dependencies.rb:291:in `require'
2019-10-08T01:55:19.91251+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.6.0/gems/activesupport-5.2.3/lib/active_support/dependencies.rb:378:in `block in require_or_load'
2019-10-08T01:55:19.912511+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.6.0/gems/activesupport-5.2.3/lib/active_support/dependencies.rb:37:in `block in load_interlock'
2019-10-08T01:55:19.912514+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.6.0/gems/activesupport-5.2.3/lib/active_support/dependencies/interlock.rb:14:in `block in loading'
2019-10-08T01:55:19.912516+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.6.0/gems/activesupport-5.2.3/lib/active_support/concurrency/share_lock.rb:151:in `exclusive'
2019-10-08T01:55:19.912519+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.6.0/gems/activesupport-5.2.3/lib/active_support/dependencies/interlock.rb:13:in `loading'
2019-10-08T01:55:19.912521+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.6.0/gems/activesupport-5.2.3/lib/active_support/dependencies.rb:37:in `load_interlock'
2019-10-08T01:55:19.912522+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.6.0/gems/activesupport-5.2.3/lib/active_support/dependencies.rb:356:in `require_or_load'
2019-10-08T01:55:19.912524+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.6.0/gems/bootsnap-1.4.5/lib/bootsnap/load_path_cache/core_ext/active_support.rb:48:in `block in require_or_load'
2019-10-08T01:55:19.912526+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.6.0/gems/bootsnap-1.4.5/lib/bootsnap/load_path_cache/core_ext/active_support.rb:16:in `allow_bootsnap_retry'
2019-10-08T01:55:19.912528+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.6.0/gems/bootsnap-1.4.5/lib/bootsnap/load_path_cache/core_ext/active_support.rb:47:in `require_or_load'
2019-10-08T01:55:19.91253+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.6.0/gems/activesupport-5.2.3/lib/active_support/dependencies.rb:334:in `depend_on'
2019-10-08T01:55:19.912532+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.6.0/gems/bootsnap-1.4.5/lib/bootsnap/load_path_cache/core_ext/active_support.rb:85:in `depend_on'
2019-10-08T01:55:19.912534+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.6.0/gems/activesupport-5.2.3/lib/active_support/dependencies.rb:246:in `require_dependency'
2019-10-08T01:55:19.912542+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.6.0/gems/railties-5.2.3/lib/rails/engine.rb:478:in `block (2 levels) in eager_load!'
2019-10-08T01:55:19.912555+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.6.0/gems/railties-5.2.3/lib/rails/engine.rb:477:in `each'
2019-10-08T01:55:19.912557+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.6.0/gems/railties-5.2.3/lib/rails/engine.rb:477:in `block in eager_load!'
2019-10-08T01:55:19.912559+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.6.0/gems/railties-5.2.3/lib/rails/engine.rb:475:in `each'
2019-10-08T01:55:19.912561+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.6.0/gems/railties-5.2.3/lib/rails/engine.rb:475:in `eager_load!'
2019-10-08T01:55:19.912563+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.6.0/gems/railties-5.2.3/lib/rails/engine.rb:356:in `eager_load!'
2019-10-08T01:55:19.912565+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.6.0/gems/railties-5.2.3/lib/rails/application/finisher.rb:69:in `each'
2019-10-08T01:55:19.912568+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.6.0/gems/railties-5.2.3/lib/rails/application/finisher.rb:69:in `block in <module:Finisher>'
2019-10-08T01:55:19.912569+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.6.0/gems/railties-5.2.3/lib/rails/initializable.rb:32:in `instance_exec'
2019-10-08T01:55:19.912571+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.6.0/gems/railties-5.2.3/lib/rails/initializable.rb:32:in `run'
2019-10-08T01:55:19.912573+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.6.0/gems/railties-5.2.3/lib/rails/initializable.rb:61:in `block in run_initializers'
2019-10-08T01:55:19.912575+00:00 app[web.1]: from /app/vendor/ruby-2.6.5/lib/ruby/2.6.0/tsort.rb:228:in `block in tsort_each'
2019-10-08T01:55:19.912577+00:00 app[web.1]: from /app/vendor/ruby-2.6.5/lib/ruby/2.6.0/tsort.rb:350:in `block (2 levels) in each_strongly_connected_component'
2019-10-08T01:55:19.912579+00:00 app[web.1]: from /app/vendor/ruby-2.6.5/lib/ruby/2.6.0/tsort.rb:431:in `each_strongly_connected_component_from'
2019-10-08T01:55:19.912581+00:00 app[web.1]: from /app/vendor/ruby-2.6.5/lib/ruby/2.6.0/tsort.rb:349:in `block in each_strongly_connected_component'
2019-10-08T01:55:19.912583+00:00 app[web.1]: from /app/vendor/ruby-2.6.5/lib/ruby/2.6.0/tsort.rb:347:in `each'
2019-10-08T01:55:19.912585+00:00 app[web.1]: from /app/vendor/ruby-2.6.5/lib/ruby/2.6.0/tsort.rb:347:in `call'
2019-10-08T01:55:19.912587+00:00 app[web.1]: from /app/vendor/ruby-2.6.5/lib/ruby/2.6.0/tsort.rb:347:in `each_strongly_connected_component'
2019-10-08T01:55:19.912589+00:00 app[web.1]: from /app/vendor/ruby-2.6.5/lib/ruby/2.6.0/tsort.rb:226:in `tsort_each'
2019-10-08T01:55:19.912591+00:00 app[web.1]: from /app/vendor/ruby-2.6.5/lib/ruby/2.6.0/tsort.rb:205:in `tsort_each'
2019-10-08T01:55:19.912593+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.6.0/gems/railties-5.2.3/lib/rails/initializable.rb:60:in `run_initializers'
2019-10-08T01:55:19.912595+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.6.0/gems/railties-5.2.3/lib/rails/application.rb:361:in `initialize!'
2019-10-08T01:55:19.912603+00:00 app[web.1]: from /app/config/environment.rb:5:in `<main>'
2019-10-08T01:55:19.912606+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.6.0/gems/bootsnap-1.4.5/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:22:in `require'
2019-10-08T01:55:19.912608+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.6.0/gems/bootsnap-1.4.5/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:22:in `block in require_with_bootsnap_lfi'
2019-10-08T01:55:19.91261+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.6.0/gems/bootsnap-1.4.5/lib/bootsnap/load_path_cache/loaded_features_index.rb:92:in `register'
2019-10-08T01:55:19.912612+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.6.0/gems/bootsnap-1.4.5/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:21:in `require_with_bootsnap_lfi'
2019-10-08T01:55:19.912614+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.6.0/gems/bootsnap-1.4.5/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:30:in `require'
2019-10-08T01:55:19.912616+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.6.0/gems/activesupport-5.2.3/lib/active_support/dependencies.rb:291:in `block in require'
2019-10-08T01:55:19.912618+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.6.0/gems/activesupport-5.2.3/lib/active_support/dependencies.rb:257:in `load_dependency'
2019-10-08T01:55:19.912625+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.6.0/gems/activesupport-5.2.3/lib/active_support/dependencies.rb:291:in `require'
2019-10-08T01:55:19.912628+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.6.0/gems/bootsnap-1.4.5/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:48:in `require_relative'
2019-10-08T01:55:19.91263+00:00 app[web.1]: from config.ru:3:in `block in <main>'
2019-10-08T01:55:19.912632+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.6.0/gems/rack-2.0.7/lib/rack/builder.rb:55:in `instance_eval'

1 个答案:

答案 0 :(得分:4)

heroku控制台给您的错误更多地是Heroku生产规则:

警告#1 您的gemfile中有一个import java.awt.BorderLayout; import java.awt.EventQueue; import java.net.NetworkInterface; import java.util.ArrayList; import java.util.Enumeration; import java.util.List; import javax.swing.DefaultComboBoxModel; import javax.swing.JComboBox; import javax.swing.JFrame; import javax.swing.JLabel; import javax.swing.JPanel; import javax.swing.SwingWorker; import javax.swing.WindowConstants; public class SwngWrkr implements Runnable { private JComboBox<Object> combo; private JFrame frame; public void run() { showGui(); } private JPanel createMainPanel() { JPanel mainPanel = new JPanel(); mainPanel.add(new JLabel("Interfaces")); DefaultComboBoxModel<Object> model = new DefaultComboBoxModel<Object>(); model.addElement("Loading..."); combo = new JComboBox<Object>(model); mainPanel.add(combo); return mainPanel; } private void showGui() { frame = new JFrame("SW"); frame.setDefaultCloseOperation(WindowConstants.EXIT_ON_CLOSE); frame.add(createMainPanel(), BorderLayout.CENTER); frame.pack(); frame.setLocationByPlatform(true); frame.setVisible(true); new GetIfTsk(combo).execute(); } public static void main(String[] args) { SwngWrkr instance = new SwngWrkr(); EventQueue.invokeLater(instance); } } class GetIfTsk extends SwingWorker<Void, Void> { private JComboBox<Object> combo; private List<Object> netIfNames; public GetIfTsk(JComboBox<Object> combo) { this.combo = combo; netIfNames = new ArrayList<>(); } protected Void doInBackground() throws Exception { Enumeration<NetworkInterface> ifs = NetworkInterface.getNetworkInterfaces(); int ndx = 0; while (ifs.hasMoreElements()) { NetworkInterface ni = ifs.nextElement(); String name = ni.getName(); System.out.printf("%2d. %s%n", ++ndx, name); netIfNames.add(name); } return null; } protected void done() { DefaultComboBoxModel<Object> model = (DefaultComboBoxModel<Object>) combo.getModel(); model.removeAllElements(); model.addAll(netIfNames); model.setSelectedItem(netIfNames.get(0)); } } 。我有同样的错误,必须将其删除,以使其与heroku pushs不能混淆。 请参阅Heroku Removing Gemfile.lock because it was generated on Windows

警告#2 Heroku尚未为您的应用检测到存储桶。告诉您的是,如果您上传文件,图像或任何可上传文件,则不会花费太多时间。您只会看到它几分钟,然后它会消失。我推荐一些AWS Bucket服务,您可以在这里查看:https://medium.com/alturasoluciones/setting-up-rails-5-active-storage-with-amazon-s3-3d158cf021ff

警告#3 该警告与第二个警告有关,您需要为activeStorage添加Herokus buildpack:

x86-mingw32

每当您有两种类型的环境时,您都需要具有单独的内部版本才能使每种环境都能正常工作。 请参阅: https://blog.heroku.com/rails-active-storage https://github.com/heroku/heroku-buildpack-activestorage-preview

警告#4 这是一个公共错误,不会影响您的代码,但有时很烦人。该错误指定使用procfile,在该文件中,您需要指定用于启动应用程序的文件。在这种情况下,大多数Rails Apps都是美洲豹。我强烈建议您查看:https://devcenter.heroku.com/articles/deploying-rails-applications-with-the-puma-web-server

按照以下简单步骤进行操作,以便heroku知道您正在使用什么服务来启动heroku应用。

希望这对您有用。编码愉快!

相关问题