Ruby   发布时间:2022-04-03  发布网站:大佬教程  code.js-code.com
大佬教程收集整理的这篇文章主要介绍了ruby-on-rails – Heroku upload – 预编译资产失败大佬教程大佬觉得挺不错的,现在分享给大家,也给大家做个参考。
我需要帮助.当试图上传我的应用程序到heroku,我得到这个错误,谁知道为什么?有几个是错的谢谢
Using rake (10.1.0)
       ...
       Using tlsmail (0.0.1)
       Using uglifier (2.1.2)
       Your bundle is complete! It was installed into ./vendor/bundle
-----> WriTing config/database.yml to read from DATABASE_URL
-----> Preparing app for Rails asset pipeline
       Running: rake assets:precompile
       /tmp/build_e8889be5-168c-49ed-81e7-b71061fc82ee/vendor/bundle/ruby/1.9.1/gems/tlsmail-0.0.1/lib/net/smtp.rb:806: warning: already initialized constant SMTPSession
       ...
       /tmp/build_e8889be5-168c-49ed-81e7-b71061fc82ee/vendor/bundle/ruby/1.9.1/gems/tlsmail-0.0.1/lib/net/pop.rb:702: warning: already initialized constant APOPSession
       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 bundle them in your Gemfile,or fold 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/2012/1/4/rails-3-2-0-rc2-has-been-released. (called from <top (required)> at /tmp/build_e8889be5-168c-49ed-81e7-b71061fc82ee/Rakefile:7)
       ...
       rake aborted!
       could not connect to server: Connection refused
       Is the server running on host "127.0.0.1" and accepTing
       TCP/IP connections on port 5432?
       /tmp/build_e8889be5-168c-49ed-81e7-b71061fc82ee/vendor/bundle/ruby/1.9.1/gems/activerecord-3.2.12/lib/active_record/connection_adapters/POSTGResql_adapter.rb:1208:in `initialize'
       /tmp/build_e8889be5-168c-49ed-81e7-b71061fc82ee/vendor/bundle/ruby/1.9.1/gems/activerecord-3.2.12/lib/active_record/connection_adapters/POSTGResql_adapter.rb:1208:in `new'
       ...
       /tmp/build_e8889be5-168c-49ed-81e7-b71061fc82ee/vendor/bundle/ruby/1.9.1/gems/actionpack-3.2.12/lib/sprockets/assets.rake:29:in `block (2 levels) in <top (required)>'
       Tasks: TOP => environment
       (See full trace by running task with --tracE)
 !
 !     Precompiling assets failed.

解决方法

Heroku docs

要解决此问题,请确保您的config / application.rb中显示以下行:

# config/application.rb
config.assets.initialize_on_precompile = false

一旦添加,提交您的更改并重新部署到Heroku – 您的资产应该编译没有您的应用程序尝试连接到数据库,这将解决您正在目睹的错误.

更新:

your stacktrace第46行包含以下消息:Devise.secret_key未设置.

According作者Devise,José Valim,此问题可以通过以下方式解决:

或者,the following solution似乎已经为一些用户工作:

大佬总结

以上是大佬教程为你收集整理的ruby-on-rails – Heroku upload – 预编译资产失败全部内容,希望文章能够帮你解决ruby-on-rails – Heroku upload – 预编译资产失败所遇到的程序开发问题。

如果觉得大佬教程网站内容还不错,欢迎将大佬教程推荐给程序员好友。

本图文内容来源于网友网络收集整理提供,作为学习参考使用,版权属于原作者。
如您有任何意见或建议可联系处理。小编QQ:384754419,请注明来意。