Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Can't run heroku or vagrant in cygwin, but OK in cmd

Tags:

cygwin

Somehow, I can't run vagrant or heroku in cygwin. It works fine when I'm using the default windows cmd application, but in cygwin, I get this error for vagrant:

C:/vagrant/vagrant/embedded/lib/ruby/site_ruby/1.9.1/rubygems/dependency.rb:247:in to_specs': Could not find vagrant (>= 0) amongst [] (Gem::LoadError) from C:/vagrant/vagrant/embedded/lib/ruby/site_ruby/1.9.1/rubygems/dependency.rb:256:into_spec' from C:/vagrant/vagrant/embedded/lib/ruby/site_ruby/1.9.1/rubygems.rb:1231:in gem' from C:/vagrant/vagrant/embedded/gems/bin/vagrant:22:in'

And for heroku:

C:\Program Files (x86)\ruby-1.9.2\bin\ruby.exe: No such file or directory -- /cygdrive/c/Program Files (x86)/Heroku/bin/heroku (LoadError)

What is this thing about ruby? I have no idea what I should be doing - developing in windows is a real pain, can anyone provide any insight into how I might solve this problem?

Appreciate any help. Thanks!

like image 256
K L Avatar asked Mar 08 '13 08:03

K L


2 Answers

I ran in the same problem using Rails and Heroku on Windows.

It seems that the Toolbelt is not supported under Cygwin. Moreover colors are not always rendered in the right way (for example, I did not manage to render heroku logs colors, even after using ansicon -i).

I also considered using the CMD Prompt augmented with GOW but that means you have to append ".bat" to every command, and colors are still a problem.

I ended up using the Git Bash shell that is included with the RailsInstaller package. It recongnizes all paths to relevant files, it has all the shell commands you need, and every color seems to be rendered correctly (e.g. rails logs, cucumber and rspec tests, heroku logs, etc.).

like image 105
Franco Avatar answered Oct 17 '22 08:10

Franco


You've probably solved your issue a long time ago but I just wanted to add the steps I went through as I had the same issue on Windows with Cygwin.

Firstly always try to do an update of your Cygwin installation especially when you see an error similar to the one you've posted (I had the same error):

/ruby: No such file or directoryin/heroku: line 4: /cygdrive/d/Development/Heroku/ruby-1.9.2/bin

So I updated Cygwin and made sure to select all necessary ruby packages/interpreters etc, but this still didn't solve the problem as I kept getting the same error message.

Then I followed the steps outlined in Running the Heroku Command-Line Client Under Cygwin:

(1) Download RubyGem 1.9.3 from http://rubyforge.org/frs/download.php/76072/rubygems-1.8.24.zip

(2) Then run the following -

$ unzip rubygems-1.8.24.zip
$ cd rubygems-1.8.24/rubygems-1.8.24
$ ruby setup.rb install
$ gem update --system
$ gem install heroku

(3) Open a new shell window and verify the version -

$ heroku version
heroku-gem/2.28.10 (i386-cygwin) ruby/1.8.7

This solved my problem and I can now run heroku commands from the Cygwin shell on Windows.

like image 4
Azkuma Avatar answered Oct 17 '22 09:10

Azkuma