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?
You probably don't have the Bundler gem installed.
Assuming you have Ruby installed:
gem install bundler
should do the trick.
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.
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 "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##
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
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:
I fired up a command prompt (Note: with administrator privilege )
I did gem install bundler once 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 -v using Git Bash but it still is not working somehow.
I restarted my laptop, And surprisingly now it is works.
Hope this is helpful to anyone.
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!
Related
I recently switched to zsh from bash and couldn't install any npm bundles. I found some stack overflows telling me to reset the path in my zsh profile, which I did. Now I can't execute any commands, including bundle install.
Things I've tried:
PATH=/usr/bin:/bin:/usr/sbin:/sbin
export path
from the command line
Modifying ~/.zshrc to add
PATH=/usr/bin:/bin:/usr/sbin:/sbin
export PATH
, then saving and restarting iTerm.
When I echo $PATH, this is what I get: /usr/bin:/bin:/usr/sbin:/sbin
Restarting my terminal after each change, I still get: zsh: command not found: bundle
Help would be greatly appreciated!
UPDATE: I tried switching to another computer and cloning the repo down and am getting the same error when I try to bundle install. If I switch to another repo on the other computer (where I didn't mess with the path), bundle install works. On my initial computer (with the path edits), none of the repos allow bundle install.
Do you know where is your bundle program (you can use locate or find) ? It can be in another directory that is not in your path. For example, it can be in /usr/local/bin so you should add this path to your $PATH.
I have just downloaded the latest Git for Windows installer, v2.4. It appears to want to install to the standard Windows "Program files" (with-spaces-in-name) directory.
Since I have all my development code in a folder called (simply) "/bin" -- I want to see if there's a command line option or parameter to change the install directory.
In my case, these days I use a environment variable such as GIT_HOME for important software like git; so it would be useful if there was a way to apply that to things like git commands, etc once I have the program installed.
possibly related:
How do I change the directory in Git Bash with Git for Windows?
I also came across a few questions asking: "whereis git". That's answered above, however I take that as an indicator that others may want git somewhere else too.
To start the installer with a different installation path you can open a CMD terminal in the same directory as the installer executable and pass in an option parameter of /DIR="x:\dirname"
For instance, if you have version 2.17.0 for Windows 64bit and you want to install git to D:\git, you would run:
Git-2.17.0-64-bit.exe /DIR="D:\git"
The installer will launch as usual and you need to walk through the other options, but the install location will be the path specified.
Since I just ran into this problem because my SSD is filling up, I figured I'd share the solution I came to on Windows 11 with Git v. 2.37.2.
The best way I could figure was to uninstall Git, then in CMD Prompt use the suggested command from the Git website with an appended --location/ -l flag:
winget install --id Git.Git -e --source winget --location [drive:/directory]
where [drive:/directory] is your target for the install. Had no issues and verified it worked with a project.
I am using Git Bash on Windows Vista Business. I am trying to install Redmine. Basically on step 4, I need to get RubyGem installed before I install the bundler as part of the dependency install (http://www.redmine.org/projects/redmine/wiki/RedmineInstall). I downloaded rubygems-2.2.2.zip from https://rubygems.org/pages/download. Then I unzipped the file a folder on my desktop.
In Git Bash, I typed ruby setup.rb, I get sh.exe: ruby: command not found. Is it something related to the PATH environment? If so, how do I include it so that Git Bash will see the setup file and run it?
Ruby 1.9.3- p545 is already installed.
Thanks in advance.
If you already installed ruby, you have to include correct path.
Right click My Computer, click Properties, go to Advanced System Settings left navigation, click on Environment Variables... button, go to System Variables below, select Path, click Edit and in the beginning of the path enter: C:\Ruby200\bin; (Please note that in here you should indicate the ruby executable path. In case you installed ruby using Ruby installer for windows then the above mentioned path is correct).
Windows, when I try to run npm install, it shows:
mean#1.0.0 postinstall E:\mean
node node_modules/grunt-cli/bin/grunt install
Running "bower:install" (bower) task
Fatal error : git is not installed or not in the PATH
npm ERR! weird error 1
npm ERR! not ok code 0
What is the problem? How to fix it?
The project git repository is https://github.com/linnovate/mean
Did you install Git correctly?
According to the Bower site, you need to make sure you check the option "Run Git from Windows Command Prompt".
I had this issue where Git was not found when I was trying to install Angular. I re-ran the installer for git and changed my setting and then it worked.
From the bower site:
http://bower.io/
while #vitocorleone is technically correct. If you have already installed, there is no need to reinstall. You just need to add it to your path. You will find yourself doing this for many of the tools for the mean stack so you should get used to doing it. You don't want to have to be in the folder that holds the executable to run it.
Control Panel --> System and Security --> System
click on Advanced System Settings on the left.
make sure you are on the advanced tab
click the Environment Variables button on the bottom
under system variables on the bottom find the Path variable
at the end of the line type (assuming this is where you installed it)
;C:\Program Files (x86)\git\cmd
click ok, ok, and ok to save
This essentially tells the OS.. if you don't find this executable in the folder I am typing in, look in Path to fide where it is.
Installing git and running npm install from git-bash worked for me. Make sure you are in the correct directory.
Install git and tortoise git for windows and make sure it is on your path, (the installer for Tortoise Git includes options for the command line tools and ensuring that it is on the path - select them).
You will need to close and re-open any existing command line sessions for the changes to take effect.
Then you should be able to run npm install successfully or move on to the next problem!
In my case the issue was not resolved because i did not restart my system. Please make sure you do restart your system.
If you installed GitHubDesktop then the path for git.exe will be ,
C:\Users\<'Username'>\AppData\Local\GitHubDesktop\app-1.1.1\resources\app\git\cmd
Add this path to the environment variables by following,
** (Note: \cmd at the end, not \cmd\git.exe).**
Navigate to the Environmental Variables Editor and find the Path variable in the “System Variables” section. Click Edit… and paste the URL of Git to the end. Save!
Now open a new cmd and type command git. If you are able to see the git usage then it's done.
Now you can execute your command to install your package.
ex: npm install native-base --save
Use Git CMD instead of using Win CMD.
I did install git and tried again and got the same error. But running 'npm install' in a new command prompt window worked for me. Restarting the machine is not required.
Go to Environmental Variables you will find this in Computer Properties->Advance system Setting->Environmental Variables -> Path
Add the path of your git installed int the system.
eg: "C:\Program Files\Git\cmd"
Save it.
Good to go now!!
The issue depends on the command prompt you are using. if you are using your Windows cmd, then it will be fine if you have installed git in your system (note that after installation it gets added to your system path). if you are running on an Anaconda terminal or any other, then you need to install git on your project environment from the terminal.
for anaconda, the problem gets solved by running:
conda install git
I simply followed the getting started with nodejs tutorial from Heroku.
https://devcenter.heroku.com/articles/getting-started-with-nodejs#declare-process-types-with-procfile
But I get an error at the part "declare process types with procfile"
My problem is that my cmd (using windows 7) didn't find the command "foreman"
Any solutions ?
I downloaded/installed the heroku toolbelt, the login works fine, but foreman dont
I had the same problem on Windows7 64-bit, using git's bash. Here's what I did:
uninstall the toolbelt, Ruby, and Git using Control Panel's "Program and Features"
reinstall the toolbelt to C:\Heroku (see known issue for more info)
add C:\Program Files (x86)\git\bin;C:\Heroku\ruby-1.9.2\bin to the system PATH variable: Control Panel, System, Advanced system settings, Environment Variables..., System variables, Variable Path, Edit... (Change ruby-1.9.2 if a future version of the toolbelt includes a newer version of Ruby.)
open a git bash window and uninstall foreman version 0.63$ gem uninstall foreman
then install version 0.61 (see here for more info)$ gem install foreman -v 0.61
Now foreman worked for me:
$ foreman start
You can do this without uninstall/reinstall:
Open Environment Variables
Add C:\Program Files (x86)\Heroku\ruby-x.x.x\bin to system path (assuming that you installed heroku toolbelt in this directory).
You're done! try it by opening a new shell window and typing foreman start .
Foreman finished support for Windows. You can use forego instead. It is a foreman implementation in GO lang.
https://github.com/ddollar/forego
Adding C:\Program Files (x86)\Heroku\ruby-1.9.3\bin to the Environment variable PATH worked for me.
After installing Heroku toolbelt, I was getting weird errors about required modules when running foreman start. Adding the ruby bin directory to path, and reopening the shell window did not work for me. It seems that foreman was never installed! When I attempted to uninstall foreman, ruby told me it was not installed. So I ran gem install foreman, and 0.77 was installed. One gotcha, I had to open the shell to install the foreman gem as Administrator. Maybe that is how the Heroku toolbelt seems to not have installed properly the first time. Running foreman start seemed to do something after it was installed (naturally).