izn
izn

Reputation: 310

cap command not found [Cygwin + Capistrano]

I've installed ruby, rubygems and rails through Cygwin setup. Then I've installed a gem:
gem install capistrano --verbose

No problem here. But when I try to run cap command, Cygwin tells me:
cap: command not found

When I execute in ./bin/cap it works:
$ ./bin/cap Stage not set, please call something such as 'cap production deploy', where production is a stage you have defined.

Here is my gem environment:
$ gem environment RubyGems Environment: - RUBYGEMS VERSION: 2.4.1 - RUBY VERSION: 2.0.0 (2014-11-13 patchlevel 598) [i386-cygwin] - INSTALLATION DIRECTORY: /home/Moretti/.gem/ruby - RUBY EXECUTABLE: /usr/bin/ruby.exe - EXECUTABLE DIRECTORY: /home/Moretti/bin - SPEC CACHE DIRECTORY: /home/Moretti/.gem/specs - SYSTEM CONFIGURATION DIRECTORY: /etc - RUBYGEMS PLATFORMS: - ruby - x86-cygwin - GEM PATHS: - /home/Moretti/.gem/ruby - /usr/share/gems - /usr/local/share/gems - GEM CONFIGURATION: - :update_sources => true - :verbose => true - :backtrace => false - :bulk_threshold => 1000 - REMOTE SOURCES: - https://rubygems.org/ - SHELL PATH: - /usr/local/bin - /usr/bin - /cygdrive/c/Program Files (x86)/Intel/iCLS Client - /cygdrive/c/Program Files/Intel/iCLS Client - /cygdrive/c/WINDOWS/system32 - /cygdrive/c/WINDOWS - /cygdrive/c/WINDOWS/System32/Wbem - /cygdrive/c/WINDOWS/System32/WindowsPowerShell/v1.0 - /cygdrive/c/Program Files/Intel/Intel(R) Management Engine Components/DAL - /cygdrive/c/Program Files/Intel/Intel(R) Management Engine Components/IPT - /cygdrive/c/Program Files (x86)/Intel/Intel(R) Management Engine Componen ts/DAL - /cygdrive/c/Program Files (x86)/Intel/Intel(R) Management Engine Componen ts/IPT - /usr/bin

The EXECUTABLE DIRECTORY is correct, but the binaries aren't working outside the ~/bin/.

What can I do?

Upvotes: 0

Views: 1743

Answers (1)

thewheat
thewheat

Reputation: 988

I created a cap file in /usr/local/bin/ and made it executable.

$ cat /usr/local/bin/cap
#!/bin/bash
ruby ~/.gem/ruby/gems/capistrano-3.3.5/bin/cap "$@"

Location of capistrano gem files can be found using gem which capistrano.

I personally do not know if this is the best way of doing it, but I've just set it up yesterday and have managed to get it working for my usecase

Upvotes: 1

Related Questions