5

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!

K L
  • 1,373
  • 2
  • 15
  • 21

4 Answers4

5

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.).

Community
  • 1
  • 1
Franco
  • 669
  • 2
  • 8
  • 23
4

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.

Josh Unger
  • 6,717
  • 6
  • 33
  • 55
Azkuma
  • 301
  • 2
  • 8
  • Heroku Toolbelt had already installed RubyGem, so I just needed: $ gem update --system and $ gem install heroku Worked. – eddyparkinson Dec 01 '14 at 06:11
1

For me @Azkuma's answer only got me half the way. What worked for me:

1) Download and extract RubyGem zip: https://rubygems.org/pages/download

2) Set aliases to gem and heroku

alias gem='C:/ruby/bin/gem'
alias heroku='"C:/Program Files (x86)/Heroku/bin/heroku.bat"'

3) install as above

ruby setup.rb install
gem update --system
gem install heroku

4) login to heroku

heroku login
dreamflasher
  • 1,387
  • 15
  • 22
0

I found simply setting an alias worked for me.

alias heroku=c:/Program\\\ Files\\\ \\\(x86\\\)/Heroku/bin/heroku.bat

Then I can just use the heroku command directly with Cygwin.

The only thing I have a problem with is heroku login (and by extension, git push heroku master) whereby I'm prompted to use cmd.exe. For that part, I just open my Git Bash window from within the relevant folder, login and push from there.

guypursey
  • 3,114
  • 3
  • 24
  • 42