gpt4 book ai didi

ruby-on-rails - 插入 Heroku 时出现错误(预编译 Assets 失败。)

转载 作者:行者123 更新时间:2023-12-02 21:40:21 26 4
gpt4 key购买 nike

注意:我使用的是 Rails 3.2.13 和 Ruby“1.9.3”以及 postgres-0.15.1

我尝试按照此网站的过程将我的 Ruby on Rails 应用程序推送到 heroku http://ruby.railstutorial.org/ruby-on-rails-tutorial-book#sec-deploying,但是我在尝试插入heroku时遇到错误

   Connecting to database specified by DATABASE_URL
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?
 !     Precompiling assets failed.
! Push rejected, failed to compile Ruby app

To <a href="https://stackoverflow.com/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="e6818f92a68e8394898d93c885898b" rel="noreferrer noopener nofollow">[email protected]</a>:pure-hamlet-9148.git
! [remote rejected] master -> master (pre-receive hook declined)

所以,我在 Google 上搜索并运行以下命令

heroku labs:disable user-env-compile
heroku labs:enable user-env-compile

仍然遇到同样的错误,请帮助我解决此问题。

最佳答案

连同西蒙娜的回答,

在部署之前,请按照此网站在本地预编译您的 Assets 。 https://devcenter.heroku.com/articles/rails-asset-pipeline

RAILS_ENV=production bundle exec rake assets:precompile
git add public/assets -f
git commit -m "vendor compiled assets"

关于ruby-on-rails - 插入 Heroku 时出现错误(预编译 Assets 失败。),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/20567806/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com