Rrub上的Jruby没有部署到Heroku?

时间:2015-11-04 19:47:49

标签: ruby-on-rails git heroku jruby

我花了好几个小时试图将我的应用部署到Heroku,但无法解决问题。我在Windows上运行并使用JDK8 Jruby9.0.0.0。我使用here找到的说明进行设置,并使用此tutorial部署新应用。我使用的确切命令是:

C:\Users\MyName>Jruby -S rails new MyApp
---
C:\Users\MyName>cd MyApp
---
C:\Users\MyName\MyApp>git init
---
C:\Users\MyName\MyApp>git add .
---
C:\Users\MyName\MyApp>git commit -m "my first commit"
---
C:\Users\MyName\MyApp>heroku create
---
C:\Users\MyName\MyApp>git push heroku master
---
C:\Users\MyName\MyApp>heroku open

不幸的是,这提供了以下" Applicaton Error"当我尝试打开应用程序时:

2015-11-04T19:28:36.377052+00:00 heroku[web.1]: Starting process with command `bin/rails server -p 27765 -e production`
2015-11-04T19:28:38.105808+00:00 app[web.1]: /usr/bin/env: jruby.exe: No such file or directory
2015-11-04T19:28:38.976959+00:00 heroku[web.1]: Process exited with status 127
2015-11-04T19:28:38.994372+00:00 heroku[web.1]: State changed from starting to crashed
2015-11-04T19:28:38.995406+00:00 heroku[web.1]: State changed from crashed to starting
2015-11-04T19:28:40.545185+00:00 heroku[web.1]: Starting process with command `bin/rails server -p 14126 -e production`
2015-11-04T19:28:41.946326+00:00 app[web.1]: /usr/bin/env: jruby.exe: No such file or directory
2015-11-04T19:28:42.503828+00:00 heroku[web.1]: State changed from starting to crashed
2015-11-04T19:28:42.496390+00:00 heroku[web.1]: Process exited with status 127
2015-11-04T19:28:43.384581+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/" host=desolate-lake-2856.herokuapp.com request_id=7d58e322-072a-4e26-bfdf-53ff637ebe97 fwd="86.174.222.227" dyno= connect= service= status=503 bytes=
2015-11-04T19:28:43.638575+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/favicon.ico" host=desolate-lake-2856.herokuapp.com request_id=af171d45-f0ce-4e2e-a0ba-1375cfb90601 fwd="86.174.222.227" dyno= connect= service= status=503 bytes=
2015-11-04T19:28:44.199636+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/favicon.ico" host=desolate-lake-2856.herokuapp.com request_id=b0e25fc6-0497-4a6b-ac71-fde22c700e57 fwd="86.174.222.227" dyno= connect= service= status=503 bytes=
2015-11-04T19:28:44.922656+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/favicon.ico" host=desolate-lake-2856.herokuapp.com request_id=d680200e-e6e2-4132-92fe-fcddf8df77f4 fwd="104.131.28.255" dyno= connect= service= status=503 bytes=

我已按照SO上的说明建议重命名bin / bundle,rails,rake以删除' .exe'但这不起作用。

关于这里出了什么问题的任何想法?谢谢!

编辑:

我应该说,Heroku教程中克隆的应用程序应该部署到Heroku,但遗憾的是它与CMD命令创建的应用程序结构完全不同.Jruby -S rails new MyApp&#39 ;。克隆的应用程序没有' bin'目录,以及' Jruby -S new' app没有procfile。我认为这意味着问题在于' Jruby -S new'应用程序配置为部署,即我需要指定进程应该如何开始?这两个应用程序都在本地运行。

我知道每次创建一个新的rails应用程序时我都可以克隆heroku应用程序,但这看起来像是一个笨重的工作!

1 个答案:

答案 0 :(得分:0)

看起来您可能已将bin/rails脚本签入Git。如果该脚本是在Windows上生成的,我认为它将包含jruby.exe。确保通过运行以下命令删除这些文件:

> git rm -rf bin

然后将bin/添加到您的`.gitignore以确保它不会重新进入。最后:

> git commit -am "remove bin scripts"
> git push heroku master