加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 百科 > 正文

ruby-on-rails – 部署到heroku时出错:rake assets:precompile

发布时间:2020-12-17 01:34:50 所属栏目:百科 来源:网络整理
导读:在尝试git将应用程序推送到heroku时,我得到了这个特定的错误: remote: Running: rake assets:precompile remote: PG::ConnectionBad: could not connect to server: Connection refusedremote: Is the server running on host "127.0.0.1" and acceptingrem
在尝试git将应用程序推送到heroku时,我得到了这个特定的错误:

remote:        Running: rake assets:precompile 
remote:        PG::ConnectionBad: could not connect to server: Connection     refused
remote:        Is the server running on host "127.0.0.1" and accepting
remote:        TCP/IP connections on port 5432?

我尝试按照文章的步骤操作:https://devcenter.heroku.com/articles/rails-asset-pipeline#troubleshooting

我的资产在本地编译而无需连接到数据库.

我还添加了config.assets.initialize_on_precompile = false

但是当尝试在heroku中部署时仍然会出现错误…

我知道我做错了什么吗?

谢谢!

P.S:我正在使用带有rails 4.2.0的spree 3.0.0

解决方法

在heroku中为您的应用创建新数据库:
heroku addons:创建heroku-postgresql

然后尝试git push to heroku

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读