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

Failed to build gem native extension. #188

Closed
yoykiee opened this issue Aug 18, 2013 · 19 comments
Closed

Failed to build gem native extension. #188

yoykiee opened this issue Aug 18, 2013 · 19 comments

Comments

@yoykiee
Copy link

yoykiee commented Aug 18, 2013

Hi! Im trying setup rails on Windows 7.

I install ruby x64 from rubyinstaller.org

C:\DevKit>ruby -v
ruby 2.0.0p247 (2013-06-27) [x64-mingw32]

After, I install Ruby 2.0.0 x64 (64bits): mingw64-64-4.7.2
"ruby dk.rb init" doesn't find installed ruby.
After, I add mannualy ruby directory.
But,

C:\DevKit>ruby dk.rb install
[INFO] Skipping existing gem override for 'C:/Ruby200-x64'
[WARN] Skipping existing DevKit helper library for 'C:/Ruby200-x64'

I searched all the internets, help, please...

PS: Im trying with mingw64-32-4.7.2, I have same errors.

@luislavena
Copy link
Member

Hello,

This is related to issue #178, please manually edit generated config.yml and point to the directory where Ruby was installed.

PS: Im trying with mingw64-32-4.7.2, I have same errors.

Please, do not mix Ruby 64bits with 32bits DevKit, as indicated in the RubyInstaller download page, you need to use the exact version of DevKit.

@yoykiee
Copy link
Author

yoykiee commented Aug 18, 2013

please manually edit generated config.yml and point to the directory where Ruby was installed.

I did it firstly!...

After, I add mannualy ruby directory.

@luislavena
Copy link
Member

Hello,

I'm not sure to understand what you're saying.

First: if you use Ruby x64 (64bits version) you need to use only mingw64-64-4.7.2 DevKit, as indicated in RubyInstaller download page.

After you have executed ruby dk.rb init, it will generate a file named config.yml, review the contents and will notice there is no mention of your Ruby x64 installation, you need to update it so it list it, like this:

- C:/Ruby200-x64

And then proceed with ruby dk.rb install

If you have problems installing some gems, please refer to the Wiki page: https://github.com/oneclick/rubyinstaller/wiki/Troubleshooting

As pointed out in RubyInstaller mailing list and here, you need to provide more information of the problems you're having.

Reference links:
#39
https://groups.google.com/forum/#!topic/rubyinstaller/cAKLJmhfG-U

@yoykiee
Copy link
Author

yoykiee commented Aug 18, 2013

C:\Devkit64>type config.yml
# This configuration file contains the absolute path locations of all
# installed Rubies to be enhanced to work with the DevKit. This config
# file is generated by the 'ruby dk.rb init' step and may be modified
# before running the 'ruby dk.rb install' step. To include any installed
# Rubies that were not automagically discovered, simply add a line below
# the triple hyphens with the absolute path to the Ruby root directory.
#
# Example:
#
# ---
# - C:/ruby19trunk
# - C:/ruby192dev
#
---
- C:/Ruby200-x64
C:\Devkit64>ruby dk.rb install
[INFO] Skipping existing gem override for 'C:/Ruby200-x64'
[WARN] Skipping existing DevKit helper library for 'C:/Ruby200-x64'

C:\Devkit64>ruby -v
ruby 2.0.0p247 (2013-06-27) [x64-mingw32]

I did everything according to the instructions.

@luislavena
Copy link
Member

@yoykiee

I did everything according to the instructions.

You're not providing the output of the error, you're just stating what you did and that worked.

Please, read the links I provided, please provide the error information I'm requesting (and that is mentioned there) please read the troubleshooting page.

@sroller
Copy link

sroller commented Aug 18, 2013

@yoykiee Yoykie,
Try to read and to understand what was explained. As @luislavena mentioned you should EDIT the config.yaml manually.

@yoykiee
Copy link
Author

yoykiee commented Aug 18, 2013

sroller,
I edited config.yml manually, I add ruby installed directory.

But I can't install DevKit!
So, I have some errors of

ERROR: Error installing :
ERROR: Failed to build gem native extension.

I read https://github.com/oneclick/rubyinstaller/wiki/Troubleshooting> ERROR: Failed to build gem native extension, and all right.

But, DevKit dont want setup! xD
T_T

So, maybe you need some information for understand how to fix my mistake, please?

Useful information before reporting an error:
C:\Devkit64>ver
Microsoft Windows [Version 6.1.7601]
C:\Devkit64>ruby -v
ruby 2.0.0p247 (2013-06-27) [x64-mingw32]
C:\Devkit64>gem -v
2.0.6

DevKit - Cant Install that!!

Win7 + rails maybe bad idea...

@luislavena
Copy link
Member

@yoykiee if english is not your first language, please state that.

By showing what you have done, it is clear DevKit has installed.

However, you're saying ERROR: Failed to build gem native extension., yet, fail to provide the exact output of which gem it is failing.

Going to say this one one last time:

Please read the following post:

https://groups.google.com/forum/#!topic/rubyinstaller/cAKLJmhfG-U

Where it outlines what you need to provide us to help you.

Please provide exactly that information, and the output shown in the console.

Not going to respond anymore unless you help us help you.

@sroller
Copy link

sroller commented Aug 18, 2013

Hi yoykie,

I run ruby on W7 but not rails.
Question: can you start gcc from the command line? Is the devkit directory
in your path?

-sr

Sent from my BlackBerry® PlayBook™
www.blackberry.com


From: "yoykiee" notifications@github.com
To: "oneclick/rubyinstaller" rubyinstaller@noreply.github.com
CC: "Steffen Roller" steffen.roller@gmail.com
Sent: 18 August, 2013 4:13 PM
Subject: Re: [rubyinstaller] Failed to build gem native extension. (#188)

sroller,
I edited config.yml manually, I add ruby installed directory.

But I can't install DevKit!
So, I have some errors of

ERROR: Error installing :
ERROR: Failed to build gem native extension.

I read https://github.com/oneclick/rubyinstaller/wiki/Troubleshooting>ERROR:
Failed to build gem native extension, and all right.

But, DevKit dont want setup! xD
T_T

So, maybe you need some information for understand how to fix my mistake,
please?

Useful information before reporting an error:
C:\Devkit64>ver
Microsoft Windows [Version 6.1.7601]
C:\Devkit64>ruby -v
ruby 2.0.0p247 (2013-06-27) [x64-mingw32]
C:\Devkit64>gem -v
2.0.6

DevKit - Cant Install that!!

Win7 + rails maybe bad idea...


Reply to this email directly or view it on
GitHubhttps://github.com//issues/188#issuecomment-22838199
.

@yoykiee
Copy link
Author

yoykiee commented Aug 18, 2013

luislavena,
Version of Windows: Windows 7 Proffesional
Version of Ruby (ruby --version): ruby 2.0.0p247 (2013-06-27) [x64-mingw32](latest from rubyinstaller.org)
Version of RubyGems (gem --version) 2.0.6
Indicate that you have installed DevKit (according to the instructions) and which version (exact filename). Haven't, trying setup it
Full command line executed that caused the error (gem install ...):
When I trying setup any gems, I have a error:

Temporarily enhancing PATH to include DevKit...
Building native extensions.  This could take a while...
ERROR:  Error installing rails:
        ERROR: Failed to build gem native extension.

C:/Ruby200-x64/bin/ruby.exe extconf.rb
*** extconf.rb failed ***
Could not create Makefile due to some reason, probably lack of necessary

sroller,
No, I haven't gcc.
I dont add DevKit to %Path%, if you mean it.

@luislavena
Copy link
Member

@yoykiee

Indicate that you have installed DevKit (according to the instructions) and which version (exact filename). Haven't, trying setup it

To install DevKit, you need to follow the DevKit installation instructions listed here:

https://github.com/oneclick/rubyinstaller/wiki/Development-Kit

It is clear from your previous comments you did download and extracted DevKit, it is clear you don't understand that DevKit installation is just ruby dk.rb install after you completed the extraction and the other instructions listed in that page.

Please ensure you've the right version of DevKit, as mentioned several times already:

  • Ruby 2.0.0: mingw64-32-4.7.2
  • Ruby 2.0.0 x64 (64bits): mingw64-64-4.7.2

You need to download and extract mingw64-64-4.7.2 DevKit.

When I trying setup any gems, I have a error:

PLEASE: provide the gem name, also read the troubleshooting page:

https://github.com/oneclick/rubyinstaller/wiki/Troubleshooting

That covers most of the common problems of gem installations (due errors in the environment)

Please, do you best to read carefully what I've wrote before, follow the links that I've provided.

@luislavena
Copy link
Member

@yoykiee If you want to use Rails, I strongly recommend you uninstall and remove what you did with RubyInstaller and DevKit and instead install RailsInstaller:

http://railsinstaller.org/

Download RailsInstaller 2.2.2 version and use that instead. It should setup everything for you.

Considering your lack of experience with Ruby and dealing with the issues I've mentioned before, it is highly recommend you use something that is easier out of the box for getting started.

@yoykiee
Copy link
Author

yoykiee commented Aug 18, 2013

Im crying...
I did all the instructions that you have to offer.
I got an empty config.yml, in which the directory manually added Ruby directory. (after that I tried to write "ruby dk.rb install")
I have the correct version of Devkit.

But I still get the error when installing any binary gems.
I think it's because I have the installation error:

.... (ruby dk.rb init, editing)
C:\Devkit64>ruby dk.rb install
[INFO] Skipping existing gem override for 'C:/Ruby200-x64'
[WARN] Skipping existing DevKit helper library for 'C:/Ruby200-x64'

And I dont know what I must do or add...

Also, I add Devkit/bin/ to %path%, but I still have the error.
Sorry if I was too intrusive. Thx for all.

PS: http://railsinstaller.org/ - ruby 1.9.3 + rails 3.2 >>> so legasy.

@luislavena
Copy link
Member

@yoykiee the following is not an error:

.... (ruby dk.rb init, editing)
C:\Devkit64>ruby dk.rb install
[INFO] Skipping existing gem override for 'C:/Ruby200-x64'
[WARN] Skipping existing DevKit helper library for 'C:/Ruby200-x64'

And I dont know what I must do or add...

There is nothing else to add.

Please, remove RubyInstaller and DevKit, remove the folders it generated and install RailsInstaller instead, that comes already out of the box with the things you want to use.

This is the only and last suggestion I can provide you, you have failed to provide me with the information I've asked you several times:

Unless you step back for a second on what you're trying and READ my instructions, please do not reply to this with more issues that is lacking details.

Do yourself a favor: remove DevKit and RubyInstaller and download RailsInstaller version 2.2.2.

@nuriasakura
Copy link

I have the same exact problem. I can understand @yoykiee ...

I Installed ruby, rubygems and rubydev kit.
On the ruby website it says that I downloaded the 64x from ruby and from the dev kit.

The versions are:
C:>ruby -v
ruby 2.5.0p0 (2017-12-25 revision 61468) [x64-mingw32] (Note: I really downloaded the 64x version of the DevKit, however it appears as mingw32 on the terminal)
C:> gem -v
2.7.6

Then I did the ruby dk.rb init; I manually added ruby's location (although it was already there)

and When I do the ruby dk.rb install it goes :

C:\Users\nuria\RubyDevKit> ruby dk.rb install
[INFO] Skipping existing gem override for 'C:/Ruby25-x64'
[WARN] Skipping existing DevKit helper library for 'C:/Ruby25-x64'

I want to install jekyll. And It always ends up like:

C:> gem install jekyll
Building native extensions. This could take a while...
ERROR: Error installing jekyll:
ERROR: Failed to build gem native extension.

In other words, same situation.
PS: English is not my first language either but i do understand quite fairly.

@nuriasakura
Copy link

nuriasakura commented Feb 27, 2018

I notice that this is closed. I however I have the same exact problem.. and since there was no solution... Please reopen this issue ;-;

@luislavena @sroller

Also @yoykiee did you find the solution?

@larskanis
Copy link
Member

@nuriasakura You're using RubyInstaller-2.5. It is not compatible to the old devkit.

Instead you should run ridk install in order to download and install MSYS2. The devkit registration per ruby dk.rb init is no longer necessary.

"x64-mingw32" means the true 64-bit version - the "32" in the name is for historical reasons.

@larskanis
Copy link
Member

@nuriasakura If it still doesn't work for you, please open a ticket at RubyInstaller2.

@nuriasakura
Copy link

@larskanis thank you very much! It worked!
ridk install and 3rd option, and it worked. thanks!!!

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

5 participants