Bundle command not found Windows x64
Asked Answered
K

4

27

I just installed ruby with the Heroku Toolbelt, probem is that when I do bundle install it gives me this error:

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 Interpreter I 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:

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.

Any suggestions?

Katharina answered 16/12, 2012 at 1:35 Comment(1)
You should probably install ruby from rubyinstaller.org. The heroku toolbelt is a pain and it will mangle your environment, but with patience you can set it right again.Playmate
K
4

Well I found the solution, so I'm posting here. Problem seems to be the bundler installation in windows x64 machines, to solve this I did this.

Copy the following directories to C:/

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:

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 "bundle" 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##

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"

Hope it helps someone

Katharina answered 16/12, 2012 at 4:25 Comment(0)
B
90

You probably don't have the Bundler gem installed.

Assuming you have Ruby installed:

gem install bundler

should do the trick.

Backcourt answered 16/12, 2012 at 2:58 Comment(2)
I do have the Bundler installed, before installing it bundle was not recognized as a command. I think this will be fixed if I change the paths, but don't know how. I tried on another computer with windows x64 and trhows the same error.Katharina
Thanks! This solved my problem with a different error: bash: bundle: command not foundBaronial
K
4

Well I found the solution, so I'm posting here. Problem seems to be the bundler installation in windows x64 machines, to solve this I did this.

Copy the following directories to C:/

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:

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 "bundle" 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##

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"

Hope it helps someone

Katharina answered 16/12, 2012 at 4:25 Comment(0)
P
4

For Windows users:

I used gitbash to install 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:

  1. I fired up a command prompt (Note: with administrator privilege )
  2. I did gem install bundler once again and it installed.
  3. Now i could do something like bundle -v, It gave me the bundler version currently installed.
  4. I tried the same bundle -v using Git Bash but it still is not working somehow.
  5. I restarted my laptop, And surprisingly now it is works.

Hope this is helpful to anyone.

Perennate answered 9/4, 2018 at 7:48 Comment(0)
C
0

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:

'C:\Program Files (x86)\git\bin';'C:\Program Files (x86)\Heroku\ruby-1.9.2\bin'

That's it!

Cankerous answered 8/5, 2015 at 6:42 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.