Ruby on Rails教程Michael Hartl第2章练习(demo_app):应用程序在Windows 8 localhost上工作,但在Heroku上不起作用 [英] Ruby on Rails Tutorial by Michael Hartl Chapter 2 exercise (demo_app): app works on Windows 8 localhost, but doesn't work on Heroku

查看:94
本文介绍了Ruby on Rails教程Michael Hartl第2章练习(demo_app):应用程序在Windows 8 localhost上工作,但在Heroku上不起作用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我是网络开发新手,我正在尝试通过 Michael Hartl的书Ruby on Rails教程。我的问题在第二章(demo_app,类似微博的使用脚手架)。

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

*应用程序错误
应用程序发生错误,您的页面无法投放,请稍后重试。 p>

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



以下是Heroku的日志: p>

  2013-07-18T23:45:15 + 00:00 heroku [slug-compiler]:Slug编译开始
2013 -07-18T23:47:13.079550 + 00:00 heroku [api]:通过sergio.schuler@gmail.com增加到web = 1
2013-07-18T23:47:14.164452 + 00:00 heroku [api ]:通过sergio.schuler@gmail.com添加HEROKU_POSTGRESQL_COBALT资源
2013-07-18T23:47:14.198422 + 00:00 heroku [api]:发布v3由sergio.schuler@gmail.com创建
2013-07-18T23:47:14.289007 + 00:00 heroku [api]:通过sergio.schuler@gmail.com添加DATABASE_URL配置
2013-07-18T23:47:14.3153 43 + 00:00 heroku [api]:发布v4由sergio.schuler@gmail.com创建
2013-07-18T23:47:14.368054 + 00:00 heroku [api]:部署sergio.schuler的5c359d1 @ gmail.com
2013-07-18T23:47:14.404636 + 00:00 heroku [api]:发布v5由sergio.schuler@gmail.com创建
2013-07-18T23:47:14.455717+ 00:00 heroku [api]:部署5c359d1 by sergio.schuler@gmail.com
2013-07-18T23:47:15 + 00:00 heroku [slug-compiler]:Slug编译完成
2013 -07-18T23:47:24.815578 + 00:00 heroku [web.1]:状态从开始变为崩溃
2013-07-18T23:47:24.816243 + 00:00 heroku [web.1]:状态从崩溃改为开始
2013-07-18T23:47:29.239184 + 00:00 heroku [web.1]:用命令`bin / rails server -p 40177 -e $ RAILS_ENV`
启动进程2013-07-18T23:47:30.141486 + 00:00 app [web.1]:bash:bin / rails:没有这样的文件或目录
2013-07-18T23:47:32.030497 + 00:00 heroku [ web.1]:进程已退出,状态为127
2013-07-18T23:47:32.047706 + 00:00 heroku [web.1]:状态从启动g坠毁
2013-07-18T23:47:33.081140 + 00:00 heroku [router]:at = error code = H10 desc =App crashedmethod = GET path = / host = powerful-hamlet-1820 .herokuapp.com fwd =200.102.212.90dyno = connect = service = status = 503 bytes =
2013-07-18T23:47:33.459600 + 00:00 heroku [router]:at = error code = H10 desc =App crashedmethod = GET path = / favicon.ico host = powerful-hamlet-1820.herokuapp.com fwd =200.102.212.90dyno = connect = service = status = 503 bytes =
2013- 07-18T23:47:39.437747 + 00:00 heroku [web.1]:错误R99(平台错误) - >无法在10秒内启动测试仪
2013-07-18T23:47:39.437747 + 00:00 heroku [web.1]:用SIGKILL停止进程
2013-07-18T23:48:39.904762+ 00:00 heroku [api]:用命令`bundle exec rake db:migrate`开始进程,由sergio.schuler@gmail.com
2013-07-18T23:48:43.962916 + 00:00 heroku [run.7255 ]:等待客户端
2013-07-18T23:48:44.045577 + 00:00 heroku [run.7255]:用命令`bundle exec rake db:migrate`启动进程
2013-07-18T23: 48:45.332120 + 00:00 heroku [run.7255]:状态从开始改为
2013-07-18T23:48:49.566475 + 00:00 heroku [run.7255]:进程已退出,状态为0
2013-07-18T23:48:49.575731 + 00:00 heroku [run.7255]:状态从up改为完成
2013-07-18T23:49:12.500850 + 00:00 heroku [router] :at = error code = H10 desc =App crashedmethod = GET path = / favicon.ico host = powerful-hamlet-1820.herokuapp.com fwd =
200.102.212.90dyno = connect = service =状态= 503字节=
2013-07-18T23:49:16.494827 + 00:00 heroku [路由器] :at = error code = H10 desc =App crashedmethod = GET path = / favicon.ico host = powerful-hamlet-1820.herokuapp.com fwd =
200.102.212.90dyno = connect = service = status = 503 bytes =
2013-07-18T23:49:18.188864 + 00:00 heroku [router]:at = error code = H10 desc =应用程序崩溃方法= GET路径= / users host = hamlet-1820.herokuapp.com fwd =200.102.212.90dyno = connect = service = status = 503 bytes =
2013-07-18T23:49:18.523155 + 00:00 heroku [router]:at = error code = H10 desc =App crashedmethod = GET path = / favicon.ico host = powerful-hamlet-1820.herokuapp.com fwd =
200.102.212.90dyno = connect = service = status = 503 bytes =
2013-07-18T23:49:20.389909 + 00:00 heroku [router]:at = error code = H10 desc =App crashedmethod = GET path = / users host = powerful-hamlet-1820。 herokuapp.com fwd =200.102.212.90dyno = connect = service = status = 503 bytes =
2013-07-18T23:49:20.706606 + 00:00 heroku [router]:at = error code = H10 desc =App crashedmethod = GET path = / favicon.ico host = powerful-hamlet-1820.herokuapp.com fwd =
200.102.212.90dyno = connect = service = status = 503 bytes =
2013-07-18T23:49:19.925876 + 00:00 heroku [router]:at = error code = H10 desc =App crashedmethod = GET path = / favicon.ico host = powerful-hamlet-1820.herokuapp.com fwd =200.102.212.90dyno = connect = service = status = 503 bytes =
2013- 07-18T23:49:21.662834 + 00:00 heroku [router]:at = error code = H10 desc =App crashedmethod = GET path = / users host = powerful-hamlet-1820.herokuapp.com fwd =200.102 .212.90dyno = connect = service = status = 503 bytes =
2013-07-18T23:49:21.973127 + 00:00 heroku [router]:at = error code = H10 desc =App crashedmethod = GET path = / favicon.ico host = powerful-hamlet-1820.herokuapp.com fwd =200.102.212.90dyno = connect = service = status = 503 bytes =
2013-07-18T23:58:04.507344+ 00:00 heroku [web.1]:从崩溃状态改为开始
2013-07-18T23:58:07.786500 + 00:00 heroku [web.1]:用命令`bin / rails server - p 32660 -e $ RAILS_ENV`
2013-07-18T23:58:08.981452 + 00:00 app [web.1]:b ash:bin / rails:没有这样的文件或目录
2013-07-18T23:58:10.252381 + 00:00 heroku [web.1]:进程退出状态127
2013-07-18T23: 58:10.273793 + 00:00 heroku [web.1]:状态从开始变为崩溃
2013-07-19T00:08:40.833356 + 00:00 heroku [web.1]:状态从崩溃变为开始
2013-07-19T00:08:44.112189 + 00:00 heroku [web.1]:使用命令`bin / rails server -p 21751 -e $ RAILS_ENV`启动进程
2013-07-19T00 :08:46.119816 + 00:00 app [web.1]:bash:bin / rails:没有这样的文件或目录
2013-07-19T00:08:47.198086 + 00:00 heroku [web.1]:状态从开始变为崩溃
2013-07-19T00:08:47.181492 + 00:00 heroku [web.1]:进程已退出,状态为127
2013-07-19T00:19:17.976344 + 00 :00 heroku [web.1]:状态从崩溃状态变为开始
2013-07-19T00:19:21.334982 + 00:00 heroku [web.1]:使用命令`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或目录
2013-07-19T00:19:22.932515 + 00:00 heroku [web.1]:进程退出状态127
2013-07-19T00:19:31.846924 + 00:00 heroku [ web.1]:错误R99(平台错误) - >无法在10秒内启动测试仪
2013-07-19T00:19:31.847214 + 00:00 heroku [web.1]:使用SIGKILL停止进程

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



我也试过:

  bundle exec rake资源:预编译
git add。
git commit -am添加注释反映所做的更改
git push
heroku创建
git push heroku master
heroku rake db:迁移
heroku db:push

(最终我破解了我的本地应用程序,所以我回滚了)



我使用Windows 8并使用Railsinstaller进行安装。



对不起,如果缺少一些信息,我仍然有点新所有这些。

解决方案

错误在这里:

  2013-07-18T23:47:29.239184 + 00:00 heroku [web.1]:使用命令`bin / rails server -p 40177 -e $ RAILS_ENV` 
2013启动进程-07-18T23:47:30.141486 + 00:00 app [web.1]:bash:bin / rails:没有这样的文件或目录

尝试将 Procfile 添加到具有以下内容的应用程序:

  web:bundle exec rails server -p $ PORT 


I am new to web development and I am trying to learn RoR with Michael Hartl's book Ruby on Rails Tutorial. My problem is on Chapter 2 (the demo_app, a microblog-like using scaffolding).

The demo_app runs perfectly on localhost:3000, but when I push it to Heroku, it doesn't work (both the index and /users or /microposts) and shows the message:

*"Application Error An error occurred in the application and your page could not be served. Please try again in a few moments.

If you are the application owner, check your logs for details."*

Here is Heroku's log:

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

Here is the repository: https://github.com/sergioschuler/demo_app

I tried this too:

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

(Eventually I broke even my local app, so I rolled back)

I am using Windows 8 and installed with Railsinstaller.

Sorry if there is some info missing, I am still a bit new to all this.

解决方案

The error is here:

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

Try adding a Procfile to your application that has this:

web: bundle exec rails server -p $PORT

这篇关于Ruby on Rails教程Michael Hartl第2章练习(demo_app):应用程序在Windows 8 localhost上工作,但在Heroku上不起作用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆