heroku/usr/bin/env:‘ruby.exe \ r’:没有这样的文件或目录问题 [英] heroku /usr/bin/env: ‘ruby.exe\r’: No such file or directory problem
问题描述
因此,在过去的几周中,我一直将我的应用程序部署到同一台Heroku服务器上,并且运行良好.
So I have been deploying my app to the same heroku server for the past few weeks and it has been working great.
我刚尝试部署我的最新代码,并在尝试运行时收到此错误:
I just tried to deploy my latest code and got this error when trying to run:
heroku run rails db:migrate
我得到的错误是:
/usr/bin/env: ‘ruby.exe\r’: No such file or directory problem
我查看了有关此问题的许多其他主题,并听取了他们的建议.
I have looked at many other threads concerning this problem and taken their advice.
最常见的答案是从以下位置更改bin/bundle,bin/rails和bin/rake文件夹的第一行:
The most common answer was to change the first line of the bin/bundle, bin/rails and bin/rake folders from this:
#!/usr/bin/env ruby.exe
对此:
#!/usr/bin/env ruby
但这对我不起作用,并且我不断收到相同的错误
However did this not work for me and I keep getting the same error
此问题还有其他解决方案吗?
Any other possible solutions to this problem?
我正在Windows计算机上运行
I am running on a windows machine
推荐答案
我在运行Rails 5时遇到了同样的问题.尽管我不确定100%,但我相信这是由于bin/文件中的行尾存在问题而引起的.
I had the same issue here, running Rails 5 . Though I am not 100% sure, I believe it happened because of a problem with the line endings on the bin/ files.
我改变了Git的整体外观,处理了行尾:
I altered the global seeting on Git, dealing with line endings:
$ git config --global core.autocrlf true
然后使用以下命令更新bin文件:
And then updated the bin files, with:
rails app:update:bin
(在以前的rails版本上,按rake rails:update:bin
键)
(on previous rails versions it goes by rake rails:update:bin
)
有关Git如何处理此问题的更多信息(以及必要时如何刷新存储库): https://help.github.com/articles/dealing-with-line-endings/
More on how Git deals with this issue (and how to refresh a repository, if necessary) here: https://help.github.com/articles/dealing-with-line-endings/
这篇关于heroku/usr/bin/env:‘ruby.exe \ r’:没有这样的文件或目录问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!