gpt4 book ai didi

ruby-on-rails - Michael Hartl 的 Ruby on Rails 教程第 2 章练习(demo_app): app works on Windows 8 localhost, 但在 Heroku 上不起作用

转载 作者:可可西里 更新时间:2023-11-01 11:55:38 25 4
gpt4 key购买 nike

我是网络开发的新手,我正在尝试通过 Michael Hartl's book Ruby on Rails Tutorial 学习 RoR .我的问题在第二章(demo_app,一个使用脚手架的类似微博)。

demo_app 在 localhost:3000 上完美运行,但是当我将它推送到 Heroku 时,它不起作用(索引和/users 或/microposts)并显示消息:

*"应用程序错误应用程序发生错误,无法提供您的页面。请稍后重试。

如果您是应用程序所有者,请查看您的日志以了解详细信息。”*

这是 Heroku 的日志:

2013-07-18T23:45:15+00:00 heroku[slug-compiler]: Slug compilation started
2013-07-18T23:47:13.079550+00:00 heroku[api]: Scale to web=1 by sergio.schuler@gmail.com
2013-07-18T23:47:14.164452+00:00 heroku[api]: Attach HEROKU_POSTGRESQL_COBALT resource by sergio.schuler@gmail.com
2013-07-18T23:47:14.198422+00:00 heroku[api]: Release v3 created by sergio.schuler@gmail.com
2013-07-18T23:47:14.289007+00:00 heroku[api]: Add DATABASE_URL config by sergio.schuler@gmail.com
2013-07-18T23:47:14.315343+00:00 heroku[api]: Release v4 created by sergio.schuler@gmail.com
2013-07-18T23:47:14.368054+00:00 heroku[api]: Deploy 5c359d1 by sergio.schuler@gmail.com
2013-07-18T23:47:14.404636+00:00 heroku[api]: Release v5 created by sergio.schuler@gmail.com
2013-07-18T23:47:14.455717+00:00 heroku[api]: Deploy 5c359d1 by sergio.schuler@gmail.com
2013-07-18T23:47:15+00:00 heroku[slug-compiler]: Slug compilation finished
2013-07-18T23:47:24.815578+00:00 heroku[web.1]: State changed from starting to crashed
2013-07-18T23:47:24.816243+00:00 heroku[web.1]: State changed from crashed to starting
2013-07-18T23:47:29.239184+00:00 heroku[web.1]: Starting process with command `bin/rails server -p 40177 -e $RAILS_ENV`
2013-07-18T23:47:30.141486+00:00 app[web.1]: bash: bin/rails: No such file or directory
2013-07-18T23:47:32.030497+00:00 heroku[web.1]: Process exited with status 127
2013-07-18T23:47:32.047706+00:00 heroku[web.1]: State changed from starting to crashed
2013-07-18T23:47:33.081140+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path=/ host=powerful-hamlet-1820.herokuapp.com fwd="200.102.212.90" dyno= connect= service= status=503 bytes=
2013-07-18T23:47:33.459600+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path=/favicon.ico host=powerful-hamlet-1820.herokuapp.com fwd="200.102.212.90" dyno= connect= service= status=503 bytes=
2013-07-18T23:47:39.437747+00:00 heroku[web.1]: Error R99 (Platform error) -> Failed to launch the dyno within 10 seconds
2013-07-18T23:47:39.437747+00:00 heroku[web.1]: Stopping process with SIGKILL
2013-07-18T23:48:39.904762+00:00 heroku[api]: Starting process with command `bundle exec rake db:migrate` by sergio.schuler@gmail.com
2013-07-18T23:48:43.962916+00:00 heroku[run.7255]: Awaiting client
2013-07-18T23:48:44.045577+00:00 heroku[run.7255]: Starting process with command `bundle exec rake db:migrate`
2013-07-18T23:48:45.332120+00:00 heroku[run.7255]: State changed from starting to up
2013-07-18T23:48:49.566475+00:00 heroku[run.7255]: Process exited with status 0
2013-07-18T23:48:49.575731+00:00 heroku[run.7255]: State changed from up to complete
2013-07-18T23:49:12.500850+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path=/favicon.ico host=powerful-hamlet-1820.herokuapp.com fwd="
200.102.212.90" dyno= connect= service= status=503 bytes=
2013-07-18T23:49:16.494827+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path=/favicon.ico host=powerful-hamlet-1820.herokuapp.com fwd="
200.102.212.90" dyno= connect= service= status=503 bytes=
2013-07-18T23:49:18.188864+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path=/users host=powerful-hamlet-1820.herokuapp.com fwd="200.102.212.90" dyno= connect= service= status=503 bytes=
2013-07-18T23:49:18.523155+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path=/favicon.ico host=powerful-hamlet-1820.herokuapp.com fwd="
200.102.212.90" dyno= connect= service= status=503 bytes=
2013-07-18T23:49:20.389909+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path=/users host=powerful-hamlet-1820.herokuapp.com fwd="200.102.212.90" dyno= connect= service= status=503 bytes=
2013-07-18T23:49:20.706606+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path=/favicon.ico host=powerful-hamlet-1820.herokuapp.com fwd="
200.102.212.90" dyno= connect= service= status=503 bytes=
2013-07-18T23:49:19.925876+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path=/favicon.ico host=powerful-hamlet-1820.herokuapp.com fwd="200.102.212.90" dyno= connect= service= status=503 bytes=
2013-07-18T23:49:21.662834+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path=/users host=powerful-hamlet-1820.herokuapp.com fwd="200.102.212.90" dyno= connect= service= status=503 bytes=
2013-07-18T23:49:21.973127+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path=/favicon.ico host=powerful-hamlet-1820.herokuapp.com fwd="200.102.212.90" dyno= connect= service= status=503 bytes=
2013-07-18T23:58:04.507344+00:00 heroku[web.1]: State changed from crashed to starting
2013-07-18T23:58:07.786500+00:00 heroku[web.1]: Starting process with command `bin/rails server -p 32660 -e $RAILS_ENV`
2013-07-18T23:58:08.981452+00:00 app[web.1]: bash: bin/rails: No such file or directory
2013-07-18T23:58:10.252381+00:00 heroku[web.1]: Process exited with status 127
2013-07-18T23:58:10.273793+00:00 heroku[web.1]: State changed from starting to crashed
2013-07-19T00:08:40.833356+00:00 heroku[web.1]: State changed from crashed to starting
2013-07-19T00:08:44.112189+00:00 heroku[web.1]: Starting process with command `bin/rails server -p 21751 -e $RAILS_ENV`
2013-07-19T00:08:46.119816+00:00 app[web.1]: bash: bin/rails: No such file or directory
2013-07-19T00:08:47.198086+00:00 heroku[web.1]: State changed from starting to crashed
2013-07-19T00:08:47.181492+00:00 heroku[web.1]: Process exited with status 127
2013-07-19T00:19:17.976344+00:00 heroku[web.1]: State changed from crashed to starting
2013-07-19T00:19:21.334982+00:00 heroku[web.1]: Starting process with command `bin/rails server -p 35103 -e $RAILS_ENV`
2013-07-19T00:19:21.887922+00:00 app[web.1]: bash: bin/rails: No such file or directory
2013-07-19T00:19:22.932515+00:00 heroku[web.1]: Process exited with status 127
2013-07-19T00:19:31.846924+00:00 heroku[web.1]: Error R99 (Platform error) -> Failed to launch the dyno within 10 seconds
2013-07-19T00:19:31.847214+00:00 heroku[web.1]: Stopping process with SIGKILL

这是存储库:https://github.com/sergioschuler/demo_app

我也试过这个:

bundle exec rake assets:precompile
git add .
git commit -am "add a note reflecting changes made"
git push
heroku create
git push heroku master
heroku rake db:migrate
heroku db:push

(最终我连我的本地应用程序都亏本了,所以我回滚了)

我正在使用 Windows 8 并安装了 Railsinstaller。

抱歉,如果缺少某些信息,我对这一切还是有点陌生​​。

最佳答案

错误在这里:

2013-07-18T23:47:29.239184+00:00 heroku[web.1]: Starting process with command `bin/rails server -p 40177 -e $RAILS_ENV`
2013-07-18T23:47:30.141486+00:00 app[web.1]: bash: bin/rails: No such file or directory

尝试添加 Procfile你的应用程序有这个:

web: bundle exec rails server -p $PORT

关于ruby-on-rails - Michael Hartl 的 Ruby on Rails 教程第 2 章练习(demo_app): app works on Windows 8 localhost, 但在 Heroku 上不起作用,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/17736328/

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