Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

No rule to make target '<PATH>/ruby.h' when make.exe is present in <OTHER_PATH>/mingw64/bin #105

Closed
thisismydesign opened this issue Mar 25, 2018 · 9 comments

Comments

@thisismydesign
Copy link

What problems are you experiencing?

I'm on a fresh Windows 10 installation trying to set up Ruby and I ran into the issue already mentioned in several places: #47, gjtorikian/commonmarker#62 but no solution as of yet.

The issue is when trying to install a gem with native extension you get an error originating from make:
make: *** No rule to make target '<PATH>/ruby.h'

I think I found the cause.

Steps to reproduce

I installed Ruby via Chocolatey and proceeded to run ridk install. I simply pressed enter there which I assume is equivalent to 1 2 3. This led to the issue (also pointed out here: gjtorikian/commonmarker#62 (comment)):
'make' is not recognized as an internal or external command
To which the "solution" was (also pointed out in the same thread): https://stackoverflow.com/questions/32127524/how-to-install-and-use-make-in-windows-8-1
In our case: copy C:\tools\msys64\mingw64\bin\mingw32-make.exe C:\tools\msys64\mingw64\bin\make.exe
This seem to have fixed make not being available but produced the issue described above.

I then found MSYS2 at Chocolatey and followed instructions there with no success: https://chocolatey.org/packages/msys2

Turns out, I had to remove the manually created make.exe and it's working fine.

So I suppose there're three possible issues at hand:

  1. ridk install by itself is flawed?
  2. there's no indication that a wrong make executable is used
  3. reinstalling MSYS2 or rerunning ridk install doesn't get rid of manually placed files

Can't reproduce (1) at this point but hopefully a fresh installation will yield the same behavior. Not sure if there's even something to do about (2) (3).

In any case it's now documented at least.

What's the output from ridk version?

---
ruby:
  path: C:/tools/ruby25
  version: 2.5.0
  platform: x64-mingw32
ruby_installer:
  package_version: 2.5.0-2
  git_commit: 9e7814a
msys2:
  path: C:\tools\msys64
  title: MSYS2 64bit
  version: '20161025'
cc: x86_64-w64-mingw32-gcc (Rev1, Built by MSYS2 project) 7.3.0
sh: GNU bash, version 4.4.19(2)-release (x86_64-pc-msys)
os: Microsoft Windows [Version 10.0.16299.309]
@larskanis
Copy link
Member

Thank you for reporting this! I couldn't solve #47 to that time, but I never had the idea to install a make tool other than the one delivered by MSYS2! I'll try to reproduce this issue and to find a solution.

Possibly there is a solution on the way already. We'll bundle MSYS2 into RubyInstaller in the future, so that this installation step is no longer required. See here.

@MSP-Greg
Copy link
Contributor

I'm confused. In a full MSYS2 install (32 & 64 bit), there are two mingw32-make.exe files, one in mingw32\bin and one in mingw64\bin. make.exe is in usr/bin (along with other build files/scripts) and (probably) calls mingw32-make based on whether PATH contains the 32 or 64 folder.

So, if the 'solution' above changes behavior, it implies that either usr/bin is not in the path, or it does not contain make.exe.

Must be missing something...

@thisismydesign
Copy link
Author

@larskanis Cool, thanks!

@MSP-Greg The initial problem after a Ruby installation and ridk install is exactly one of those because as I mentioned make was not available. In the end that was resolved by a MSYS2 install via Chocolatey. I'm not sure what you refer to by "full MSYS2" install. AFAIU ridk install should also do that but it didn't quite work for me and others in gjtorikian/commonmarker#62. I tried env reload and terminal restart of course.

@MSP-Greg
Copy link
Contributor

I'm not sure what you refer to by "full MSYS2" install

By 'full' (probably the wrong term), I meant 32 & 64 bit. Now that you have MSYS2 installed, I assume make.exe is in the MSYS2 usr/bin folder?

And, yes, I've seen the issues people have reported using ridk to install MSYS2. I haven't felt up to trying a ridk install of MSYS2, as my install has a lot of additional packages in it...

Thanks, Greg

@thisismydesign
Copy link
Author

@MSP-Greg Yes, it's there.

The ridk method is referenced all around (FAQ, README, .org website). If this is a broad issue referencing e.g. the MSYS2 install via Chocolatey instead / as an alternative could be a first step.

@MSP-Greg
Copy link
Contributor

MSP-Greg commented Mar 27, 2018

@thisismydesign

Thanks. So, given the following:

  1. Before the Chocolatey install, you did have mingw32-make.exe installed in mingw64/bin
  2. make.exe is located where it should be (after the Chocolatey MSYS2 install)
  3. You haven't changed anything with Ruby
  4. Extension gems now install correctly

That would indicate that PATH is being set correctly by the RI2 runtime, but the MSYS2 install via ridk did not correctly install all the files normally in usr/bin, or at least make.exe...

@thisismydesign
Copy link
Author

thisismydesign commented Mar 27, 2018

@MSP-Greg Yep, either that or it didn't set up the path correctly (usr/bin missing) as you suggested before.

@MSP-Greg
Copy link
Contributor

Yeah, since MSYS2 has worked fine for me for a for long time, I may have this totally wrong.

@larskanis
Copy link
Member

larskanis commented Jan 8, 2019

The number of MSYS2 install issues substantially decreased since RubyInstaller comes with bundled Devkit. Please re-open the issue if adjustments for integration into Chocolatey are still required.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants