Jus*_*ick 57 ruby ruby-on-rails heroku ruby-2.0 ruby-on-rails-4
在遵循Michael Hartl的Ruby on Rails教程的Rails 4 Beta版本时,我的应用程序无法在Heroku上启动,但在本地运行良好.检查显示以下错误:bundle exec rails serverheroku logs -t
$ heroku[web.1]: State changed from crashed to starting
$ heroku[web.1]: Starting process with command `bin/rails server
-p 33847 -e $RAILS_ENV`
$ app[web.1]: bash: bin/rails: No such file or directory
$ heroku[web.1]: Process exited with status 127
$ heroku[web.1]: State changed from starting to crashed
$ heroku[web.1]: Error R99 (Platform error) -> Failed to launch the
dyno within 10 seconds
$ heroku[web.1]: Stopping process with SIGKILL
Run Code Online (Sandbox Code Playgroud)
如果我heroku run bash和检查bin目录,我可以看到,有没有一个rails可执行文件:
~$ ls bin
erb gem irb node rdoc ri ruby testrb
Run Code Online (Sandbox Code Playgroud)
我做错了什么?我完全按照教程.
小智 103
自从我升级到rails 4.0.0后,我也遇到了这个问题
运行此命令
rake rails:update:bin
Run Code Online (Sandbox Code Playgroud)
您可以访问此处获取更多信息 https://devcenter.heroku.com/articles/rails4
Jus*_*ick 39
经过一段时间的努力,我注意到我的Rails 4项目有一个/bin目录,不像我克隆的一些旧的Rails 3项目. /bin3个文件bundle,rails以及rake,但这些都没有做它对Heroku的,因为我有bin我的全球.gitignore文件.
如果你使用Git和其他语言(Java等),这是一个非常常见的忽略规则,所以要解决这个问题:
bin从中移除~/.gitignorebundle installgit add .和提交您的更改git commit -m "Add bin back"git push heroku master步骤:
bundle config --delete bin#关闭Bundler的存根生成器
rake rails:update:bin#使用新的Rails 4可执行文件
git add bin or git add bin -f#添加bin /到源代码管理
git commit -a -m "you commit message"
git push heroku master
heroku open
| 归档时间: |
|
| 查看次数: |
26764 次 |
| 最近记录: |