部署 Rails 部署到 Heroku 上,报 500 错误

azpokr · 2016年05月27日 · 最后由 azpokr 回复于 2016年05月27日 · 2366 次阅读

我用的是 mysql 数据库,部署到 heroku 上,过程如图: 我的 Gem: 我的 Database.yml: 本地是可以运行程序的,但是部署到 heroku 上大部分功能都不能用了 heroku_log:

运行 heroku run rake db:migrate了吗?

#1 楼 @leomayleomay 没有,我试试!

#1 楼 @leomayleomay 好了!谢谢前辈!

If you do not specify a web server in your Procfile, it is likely that you’re running WEBrick in production. If you continue to run WEBrick it is likely that requests will take a long time, possibly timeout, and you will need to use many more dynos than your application requires.

Rather than doing this, ensure you use a production web server.

所以你是用 WEBrick 在跑吗?

建个 Procfile 文件,用 unicorn web: bundle exec unicorn_rails -p 80 -c ./config/unicorn.rb

笔记 http://www.myrailsmap.com:3000/notes/11

#4 楼 @adamshen 哦,原来如此,谢谢前辈学习了!对了前辈,如果我要运行 db:seeds 是不是就 heroku db:seeds 就可以了?

heroku 不是默认用的 postgresql? 反正我 sqlite 什么配置不用改,部署上去就是 postgresql

#6 楼 @cqcn1991 我是用的 mysql,之前用 sqlite 也米出现过这情况

#5 楼 @azpokr 嗯,heroku run,只能执行单条语句 好吧,毕竟,免费的 能提供这个功能已经很好了 ^0^

#8 楼 @adamshen 说的也是,先这么用着好了

需要 登录 后方可回复, 如果你还没有账号请 注册新账号