ruby 未找到捆绑命令 Windows x64
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/13897825/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Bundle command not found Windows x64
提问by miguelglz
I just installed ruby with the Heroku Toolbelt, probem is that when I do bundle installit gives me this error:
我刚刚用 Heroku Toolbelt 安装了 ruby,问题是当我这样做时,bundle install它给了我这个错误:
sh.exe": /c/Program Files (x86)/ruby-1.9.3/bin/bundle: "c:/Program: bad interpreter: No such file or directory
Acording to this question Bundle command not found. Bad InterpreterI should change the PATH, but I dont know how to do this, I have changed windows PATH enviorment variable, even changed to C:\ruby-1.9.2\bin I get a similar error:
根据this question Bundle command not found。错误的解释器我应该更改 PATH,但我不知道该怎么做,我已经更改了 windows PATH 环境变量,甚至更改为 C:\ruby-1.9.2\bin 我得到了类似的错误:
sh.exe": /c/ruby-1.9.3/bin/bundle: "c:/Program: bad interpreter: No such file or directory
When I try to reinstall the Toolbelt I change the install direcotry to c:\ but still the wizard install git and ruby folders at Program Files (x86) directory.
当我尝试重新安装 Toolbelt 时,我将安装目录更改为 c:\ 但向导仍然在 Program Files (x86) 目录中安装 git 和 ruby 文件夹。
Any suggestions?
有什么建议?
采纳答案by miguelglz
Well I found the solution, so I'm posting here. Problem seems to be the bunlder installation in windows x64 machines, to solve this I did this.
好吧,我找到了解决方案,所以我在这里发帖。问题似乎是 windows x64 机器中的 bunlder 安装,为了解决这个问题,我这样做了。
Copy the following directories to C:/
将以下目录复制到 C:/
C:\Program Files (x86)\Heroku C:\Program Files (x86)\Git C:\Program Files (x86)\ruby-1.9.2
C:\Program Files (x86)\Heroku C:\Program Files (x86)\Git C:\Program Files (x86)\ruby-1.9.2
Change windows environment "Path" variable, to do this right click Computer > Properties > Advance Settings > environment variables. Path is under "System Variables" section. Edit them to this:
更改 Windows 环境“路径”变量,为此右键单击计算机 > 属性 > 高级设置 > 环境变量。路径在“系统变量”部分下。将它们编辑为:
C:\Heroku\bin;C:\ruby-1.9.2\bin;C:\git\bin;C:\git\cmd
C:\Heroku\bin;C:\ruby-1.9.2\bin;C:\git\bin;C:\git\cmd
Go to C:\ruby-1.9.2\bin and open the "bunlde" file with note pad (not the bundle.bat), change the first line from #!"c:/Program Files (x86)/ruby-1.9.2/bin/ruby.exe"##to !#!c:/ruby-1.9.2/bin/ruby.exe##
转到 C:\ruby-1.9.2\bin 并用记事本(不是 bundle.bat)打开“bunlde”文件,将第一行从更改#!"c:/Program Files (x86)/ruby-1.9.2/bin/ruby.exe"##为!#!c:/ruby-1.9.2/bin/ruby.exe##
Now go to C:\Git and change the properties (right click > properties) of the Git Bash direct access, and change the target from C:\Windows\SysWOW64\cmd.exe /c ""C:\Program Files (x86)\Git\bin\sh.exe" --login -i"to C:\Windows\SysWOW64\cmd.exe /c ""C:\Git\bin\sh.exe" --login -i"
现在转到 C:\Git 并更改 Git Bash 直接访问的属性(右键单击 > 属性),并将目标从 更改C:\Windows\SysWOW64\cmd.exe /c ""C:\Program Files (x86)\Git\bin\sh.exe" --login -i"为C:\Windows\SysWOW64\cmd.exe /c ""C:\Git\bin\sh.exe" --login -i"
Hope it helps someone
希望它可以帮助某人
回答by regulatethis
You probably don't have the Bundler gem installed.
您可能没有安装 Bundler gem。
Assuming you have Ruby installed:
假设你已经安装了 Ruby:
gem install bundler
gem install bundler
should do the trick.
应该做的伎俩。
回答by Ozesh
For Windows users:
对于 Windows 用户:
I used gitbash to install bundler.
我使用 gitbash 来安装 bundler。
gem install bundler
and the bundler was installed successfully. Even after that i was facing the same issue.
并且打包器安装成功。即使在那之后我也面临着同样的问题。
Found out that it was due to some permission issue in my case.
发现这是由于我的情况下的一些许可问题。
Here is what i did:
这是我所做的:
- I fired up a command prompt (Note:with administrator privilege )
- I did gem install bundleronce again and it installed.
- Now i could do something like bundle -v, It gave me the bundler version currently installed.
- I tried the same bundle -vusing Git Bashbut it still is not working somehow.
- I restarted my laptop, And surprisingly now it is works.
- 我启动了一个命令提示符(注意:具有管理员权限)
- 我再次安装了gem install bundler并安装了它。
- 现在我可以做类似bundle -v 的事情,它给了我当前安装的 bundler 版本。
- 我使用Git Bash尝试了相同的bundle -v但它仍然无法正常工作。
- 我重新启动了我的笔记本电脑,令人惊讶的是现在它可以工作了。
Hope this is helpful to anyone.
希望这对任何人都有帮助。
回答by BardGyver
I had these issues, and for me the only problem was the spaces in the file paths. Simply adding 's around the path fixed the problem for me:
我遇到了这些问题,对我来说唯一的问题是文件路径中的空格。只需在路径周围添加 's 即可解决我的问题:
'C:\Program Files (x86)\git\bin';'C:\Program Files (x86)\Heroku\ruby-1.9.2\bin'
'C:\Program Files (x86)\git\bin';'C:\Program Files (x86)\Heroku\ruby-1.9.2\bin'
That's it!
就是这样!

