Is there a way to get rubyinstaller to play well with cygwin?

I was not able to get jekyll to work with Ruby using cygwin on the 64-bit version of Windows 7. I had better results with rubyinstaller + devkit. It would be very nice if I could use rubyinstaller ruby ​​inside cygwin.

However, I get the following message when I try to run rake.

  $ rake page name = "pages / about.md"
 C: \ Ruby193 \ bin \ ruby.exe: No such file or directory - / cygdrive / c / Ruby193 / bin / rake (LoadError)

Is there a way to get rubyinstaller to play well with cygwin?

+6
source share
2 answers

The problem is that cygwin will convert all script paths to cygwin paths ( /cygdrive/... ).

There is no solution for this, since a script call is executed from bash on top of a rake script that calls its own Ruby.

There are many other problems that cygwin will cause, some of which are described in the RubyInstaller troubleshooting page.

One alternative will refer directly to rake.bat , skipping cygwin shebang detection.

But cygwin does not like batch files, which forces you to do cmd.exe /C rake.bat and this is a noise command line.

Another option is to install gem-exefy ( gem install gem-exefy ) and generate executable files for your installed gems ( rake.exe ).

This way you call rake.exe instead of letting cygwin figure it out.

Another alternative is to use MSYS bash (included in DevKit) instead of cygwin, which plays much better than cygwin, but you will still have problems with batch files.

As you can see, mixing non-native (cygwin) with native (RubyInstaller) has many side effects.

+5
source

I just put a few of them in my .bash_profile:

 alias gem=gem.bat alias irb=irb.bat alias rake=rake.bat 

I have never had the problems that Louis mentions.

+38
source

Source: https://habr.com/ru/post/924462/


All Articles