简体   繁体   English

Heroku部署错误

[英]Heroku deployment error

In a windows environment I am getting the following error when trying to deploy to Heroku 在Windows环境中,我尝试部署到Heroku时收到以下错误

C:/Ruby/lib/ruby/gems/1.8/gems/heroku-1.9.13/lib/heroku/commands/base.rb:32:in C:/Ruby/lib/ruby/gems/1.8/gems/heroku-1.9.13/lib/heroku/commands/base.rb:32:在 ': No such file or directory - git remote (Errno::ENOENT) from C:/Ruby/lib/ruby/gems/1.8/gems/heroku-1.9.13/lib/heroku/commands/ba se.rb:32:in shell' from C:/Ruby/lib/ruby/1.8/fileutils.rb:121:in chdir' from C:/Ruby/lib/ruby/1.8/fileutils.rb:121:in cd' from C:/Ruby/lib/ruby/gems/1.8/gems/heroku-1.9.13/lib/heroku/commands/ba se.rb:32:in shell' from C:/Ruby/lib/ruby/gems/1.8/gems/heroku-1.9.13/lib/heroku/commands/ap p.rb:52:in create' from C:/Ruby/lib/ruby/gems/1.8/gems/heroku-1.9.13/lib/heroku/command.rb: 48:in send' from C:/Ruby/lib/ruby/gems/1.8/gems/heroku-1.9.13/lib/heroku/command.rb: 48:in run_internal' from C:/Ruby/lib/ruby/gems/1.8/gems/heroku-1.9.13/lib/heroku/command.rb: 20:in run' from C:/Ruby/lib/ruby/gems/1.8/gems/heroku-1.9.13/bin/heroku:13 from C:/Ruby/bin/heroku:19:in `load' from C:/Ruby/bin/heroku:19 ':没有这样的文件或目录 - 来自C:/Ruby/lib/ruby/gems/1.8/gems/heroku-1.9.13/lib/heroku/commands/ba se.rb的git remote(Errno :: ENOENT):32 :在shell' from C:/Ruby/lib/ruby/1.8/fileutils.rb:121:in chdir'from C:/Ruby/lib/ruby/1.8/fileutils.rb:121:incc, cd' from C:/Ruby/lib/ruby/gems/1.8/gems/heroku-1.9.13/lib/heroku/commands/ba se.rb:32:in shell'from C:/Ruby/lib/ruby/gems/1.8/gems/ heroku-1.9.13 / lib / heroku / commands / ap p.rb:52:in create' from C:/Ruby/lib/ruby/gems/1.8/gems/heroku-1.9.13/lib/heroku/command.rb: 48:in发送'来自C:/Ruby/lib/ruby/gems/1.8/gems/heroku-1.9.13/lib/heroku/command.rb:48:in run_internal' from C:/Ruby/lib/ruby/gems/1.8/gems/heroku-1.9.13/lib/heroku/command.rb: 20:in run'from C:/Ruby/lib/ruby/gems/1.8/gems/heroku-1.9.13/bin / heroku:13来自C:/ Ruby / bin / heroku:19:在'load'中来自C:/ Ruby / bin / heroku:19

Any idea how I can correct this? 知道怎么纠正这个吗? This is being run from the Ruby Command line (which seems to me like the regular command line) 这是从Ruby命令行运行(在我看来像常规命令行)

Ok so I figured out a way to make it work and why it is likely happening. 好的,所以我找到了一种让它工作的方法以及它可能发生的原因。

For some reason I can only run the Ruby commands from the CMD prompt however the GIT commands only seem to work from the GIT Bash. 出于某种原因,我只能从CMD提示符运行Ruby命令,但GIT命令似乎只能在GIT Bash中运行。 When in the GIT Bash the Ruby commands don't work. 在GIT Bash中,Ruby命令不起作用。

When you run the Heroku commands to create the service it seems to want to run certain GIT commands which don't work from the CMD prompt the way I have it set up. 当您运行Heroku命令来创建服务时,它似乎想要运行某些GIT命令,这些命令无法按照我设置的方式从CMD提示中起作用。

To get around this for the moment I am adding the Heroku path for GIT as a remote manually and then pushing that manually when needed. 为了解决这个问题,我暂时将GIT的Heroku路径作为远程手动添加,然后在需要时手动推送。 An extra step but everything still works as intended. 额外的一步,但一切仍然按预期工作。

If you need help with the work around check out the information in this link: http://www.wiki.devchix.com/index.php?title=Working_around_the_%22heroku_create%22_error 如果您需要有关解决方案的帮助,请查看以下链接中的信息: http//www.wiki.devchix.com/index.php?title = Working_around_the_%22heroku_create%22_error

I'd still recommend using Git Bash over the normal windows CMD prompt.. but I know how tedious that can be sometimes. 我仍然建议在正常的Windows CMD提示下使用Git Bash ..但我知道有时候这是多么乏味。

You can bypass the need to do this however and get your Heroku gem working properly in your windows CMD prompt by adding your msysgit/bin path to your system Path variable. 您可以绕过执行此操作的需要,并通过将msysgit / bin路径添加到系统Path变量,使您的Heroku gem在Windows CMD提示符下正常工作。

That'll give your heroku gem access to the git command. 这将给你的heroku gem访问git命令。

To add heroku as remote use the following: 要将heroku添加为远程,请使用以下命令:

git remote add heroku git@heroku.com:yourappname.git git remote add heroku git@heroku.com:youppyname.git

Then push your master copy to Heroku: 然后将您的主副本推送到Heroku:

git push heroku master git push heroku master

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM