Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
520 views
in Technique[技术] by (71.8m points)

ruby - Bundle command not found. Bad Interpreter

I am having some issues with the bundler gem.

When I run "gem list" I can see that bundler is installed. "bundler (1.1.3, 1.0.21)".

However, when I try to run the command "bundle" I get the following message:

sh.exe": /c/Program Files (x86)/ruby-1.9.3/bin/bundle: "c:/Program: bad interpreter: No such file or directory

I assume that this is some path errors, but no matter how much I google, I am not able to find a solution to my problem.

Anyone have any tips?

Here are my paths:

C:Program Files (x86)AMD APPinx86_64;
C:Program Files (x86)AMD APPinx86;
C:Program FilesCommon FilesMicrosoft SharedWindows Live;
C:Program Files (x86)Common FilesMicrosoft SharedWindows Live;
C:Program Files (x86)NVIDIA CorporationPhysXCommon;
%SystemRoot%system32;
%SystemRoot%;    
%SystemRoot%System32Wbem;
%SYSTEMROOT%System32WindowsPowerShellv1.0;
C:Program Files (x86)ATI TechnologiesATI.ACECore-Static;
C:Windowssystem32gsgs8.71in;
C:Program Files (x86)Windows LiveShared;
C:DevKitin;
C:Program Files (x86)Common FilesAutodesk Shared;
C:Program FilesCommon FilesAutodesk Shared;
C:Program FilesTortoiseSVNin;
C:Program Files (x86)AutodeskBackburner;
F:Program Files (x86)Mozartin;
C:Program Files (x86)
uby-1.9.3lib
ubygems1.9.1gems
ails-3.0.9in;
C:Ruby192lib
ubygems1.9.1gems
ake-0.9.2in;
W:wampinmysqlmysql5.5.16lib;
F:Program FilesMATLABR2011bin;
F:Program Files (x86)Herokuin;
C:Program Files (x86)
uby-1.9.3in;
C:Program Files (x86)gitin;
C:Program Files (x86)gitcmd
See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

The error you're seeing indicates that the logic inside the script is looking for another item under C:Program Files... and, for some reason, whatever it's looking for was not surrounded by quotes.

So, it thinks each piece of that path that's separated by a space is a separate argument. My guess is that it's trying to run 'ruby' from the appropriate PATH variable, so:

C:Program Files (x86)
uby-1.9.3in
uby

which is interpreted as you calling

C:Program

with the arguments "Files" and "(x86) uby-1.9.3in uby". You can see why that wouldn't work ;-)

I don't know enough about your environment to tell you how to fix it, but if you are adding these things to your PATH manually then you should surround each one in quotes, in which case:

C:Program Files (x86)
uby-1.9.3in;

would become:

"C:Program Files (x86)
uby-1.9.3in"; 

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...