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

ruby-on-rails – 使用Rails预编译资产3.1

发布时间:2020-12-16 20:15:21 所属栏目:百科 来源:网络整理
导读:我正在改变Heroku,我得到… 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? 当我查阅Heroku文档Here时,它告诉我需要“在本地配置/ database.
我正在改变Heroku,我得到…

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?

当我查阅Heroku文档Here时,它告诉我需要“在本地配置/ database.yml中配置不存在的数据库”我不知道如何创建一个“不存在的数据库”?我是一个初学者,感谢您能给我的任何帮助.谢谢.

解决方法

在Heroku上,您必须在config / application.rb中设置此行:
config.assets.initialize_on_precompile = false

http://guides.rubyonrails.org/asset_pipeline.html#precompiling-assets

For faster asset precompiles,you can partially load your application
by setting config.assets.initialize_on_precompile to false in
config/application.rb,though in that case templates cannot see
application objects or methods. Heroku requires this to be false.

(编辑:李大同)

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

    推荐文章
      热点阅读