I wish to install the Ruby DevKit on Windows. I'm using Ruby 2.0 on a 32 bit Windows.
Here is my procedure:
After downloading DevKit (for version 2.0), I place the files in C: then I run these two commands:
ruby dk.rb init
then:
dk.rb install ruby
The installation does not work and the console shows me this:
[INFO] Skipping Existing gem override for 'C :/ Ruby200'
[WARN] Skipping Existing DevKit helper library for 'C :/ Ruby200'
Do you have any idea of the problem?
Thank you very much!
Those are warnings that the DevKit is already setup for that Ruby.
If you want to "force" a reinstall of the DevKit vars then you need to do
ruby dk.rb install -f
How did you install Ruby on your windows machine?
I know that RubyInstaller installs a working version of DevKit for you
http://rubyinstaller.org/downloads/
For me the answer of #Azolo was a good hint, but didn't fully work. I needed to run it like this:
ruby dk.rb install --force
Related
When I tried to setup my debug environment for Ruby.
I have to get gem package debug_base and debug_ide from repository. 'gem install xxx' command will download packages and using DevKit to compile the package. I was thinking why weren't these gem package compiled in advance? So we don't need DevKit to do build job when installing them. Is there any other purpose for DevKit?
Some packages/gems need to be compiled in advance to work because they use native extensions.
This is done automatically by ruby gem when you use the gem command.
Devkit is:
The RubyInstaller Development Kit is a toolkit that makes it easy to build and use native C/C++ extensions such as RDiscount and RedCloth for Ruby on Windows
Please help me, I am desperate.
I am encountering the following error when installing different gems:
Building native extensions. This could take a while...
ERROR: Error installing bson_ext:
ERROR: Failed to build gem native extension.
...
For this reason I want to install the Ruby DevKit. I am using the proper version (Ruby 1.9.3-p429 with DevKit-tdm-32-4.5.2-20111229-1559-sfx.exe).
I followed the proper steps:
ruby dk.rb init
ruby dk.rb review => yes, C:\Ruby193 is appearing in config.yml
ruby dk.rb install => here comes my problem. When I execute the command (in an elevated cmd), I only get these two messages:
[INFO] Updating convenience notice gem override for 'C:/Ruby193'
[INFO] Installing 'C:/Ruby193/lib/ruby/site_ruby/devkit.rb'
After that I try to verify that the DevKit is installed correctly, so I run:
gem install json --platform=ruby
and I still get the same error as at the beginning (ERROR: Failed to build gem native extension.)
Please, help!
P.S. Some additional info: when I go to C:\Ruby193\bin gcc.bat, make.bat, and sh.bat are not present, which is probably at the root of my problem...
change your system path to add devkit
It is important to note the version of the Ruby installation. I used Ruby 32 bit installation on a 64 bit machine and i tried to download the 64 bit Devkit. Even when I added the path this was useless because by ruby installation was 32 bit. So I downloaded the 32 bit Devkit and it successfully installed. Thanks for these wonderful answers and questions. They all helped.
I'm trying install devkit to instal some gems. I downloaded files and extracted properly and run ruby dk.rb init and file config.yml was created right.
When i run ruby dk.rb install i got this:
[INFO] Skipping existing gem override for 'C:/Ruby200-x64'
[WARN] Skipping existing DevKit helper library for 'C:/Ruby200-x64'
I would delete C:/Ruby200-x64 and re-extract. Then run 64 bit devkit install again. You shouldn't get that error message.
For the record though, I have a working ruby 2.0 on windows 7, and that gem wouldn't build for me either. It installed fine on 1.9.3 though.
In my opinion we're about a year away from seeing 2.0 be usable on windows.
I am trying to install the dev kit for ruby for the CommandT plugin for vim and I am hit with
C:\Users\Administrator>gem install rdiscount --platform=ruby
ERROR: Error installing rdiscount:
The 'rdiscount' native gem requires installed build tools.
Please update your PATH to include build tools or download the DevKit
from 'http://rubyinstaller.org/downloads' and follow the instructions
at 'http://github.com/oneclick/rubyinstaller/wiki/Development-Kit'
I have already run install devkit at shown below
C:\devkit>ruby dk.rb init
[INFO] found RubyInstaller v1.9.3 at C:/Ruby193
Initialization complete! Please review and modify the auto-generated
'config.yml' file to ensure it contains the root directories to all
of the installed Rubies you want enhanced by the DevKit.
C:\devkit>ruby dk.rb review
Based upon the settings in the 'config.yml' file generated
from running 'ruby dk.rb init' and any of your customizations,
DevKit functionality will be injected into the following Rubies
when you run 'ruby dk.rb install'.
C:/Ruby193
C:\devkit>ruby dk.rb install
[INFO] RubyGems override already in place for C:/Ruby193, skipping.
[WARN] DevKit helper library already exists for C:/Ruby193, skipping.
What could be possibly going wrong?
Edit: I tried
c:\devkit>ruby dk.rb install --force
Configures an MSYS/MinGW based Development Kit (DevKit) for
each of the Ruby installations on your Windows system. The
DevKit enables you to build many of the available native
C-based RubyGems that don't yet have a binary gem.
Usage: ruby dk.rb COMMAND
where COMMAND is one of:
init prepare DevKit for installation
review review DevKit install plan
install install required DevKit executables
uninstalled and installed again with a clean directory. But the error remains the same.
On this lines:
C:\devkit>ruby dk.rb install
[INFO] RubyGems override already in place for C:/Ruby193, skipping.
[WARN] DevKit helper library already exists for C:/Ruby193, skipping.
It's telling you that it didn't install the DevKit for Ruby because it already had a previous DevKit registered there.
It might be possible you relocated a previous installation of DevKit, in which case you need to perform ruby dk.rb install --force to override the RubyGems and DevKit helper script it previously skipped.
Hope that helps.
I had the same problem with ruby dk.rb install, however, as suggested with the --force option it has successfully installed my devkit which in turn had resolved a gem install failure I was getting with JSON 1.4.6 gem.
I have ruby 1.9.2p180 (2011-02-18) [i386-mingw32] installed on my windows 7 machine. Now I tried to install the JSON gem using the command, "gem install json" and got the following error.
ERROR: Error installing JSON:
The 'json' native gem requires installed build tools.
Please update your PATH to include build tools or download the DevKit
from '[http://rubyinstaller.org/downloads][1]' and follow the instructions
at '[http://github.com/oneclick/rubyinstaller/wiki/Development-Kit][2]'
Then I went and downloaded DevKit-4.5.0-20100819-1536-sfx.exe. Extracted it to C:\DevKit. And then from the command prompt, I executed the following commands.
ruby dk.rb init
After the above command is executed, I verified that config.yaml is generated and it has the path for my ruby folder added automatically. This is the line at the bottom of the config.yaml file "- C:/Ruby192"
ruby dk.rb review
I got the message that devkit functionality will be injected into the rubies when you run "ruby dk.rb install"
ruby dk.rb install
I got the following message.
[INFO] RubyGems override already in place for C:/Ruby192, skipping.
[INFO] Installing C:/Ruby192/lib/ruby/site_ruby/devkit.rb
Now I tried executing the JSON gem again using the command gem install json. Then got the same error message as before.
ERROR: Error installing JSON:
The 'json' native gem requires installed build tools.........
Am I missing something?
Follow the Instructions from the Ruby Installer Developer Kit Wiki:
Download Ruby 1.9.3 from rubyinstaller.org
Download DevKit file from rubyinstaller.org
For Ruby 1.9.3 use DevKit-tdm-32-4.5.2-20110712-1620-sfx.exe
Extract DevKit to path C:\Ruby193\DevKit
Run cd C:\Ruby193\DevKit
Run ruby dk.rb init
Run ruby dk.rb review
Run ruby dk.rb install
To return to the problem at hand, you should be able to install JSON (or otherwise test that your DevKit successfully installed) by running the following commands which will perform an install of the JSON gem and then use it:
gem install json --platform=ruby
ruby -rubygems -e "require 'json'; puts JSON.load('[42]').inspect"
I believe those installers make changes to the path. Did you try closing and re-opening the CMD window after running them and before the last attempt to install the gem that wants devkit present?
Also, be sure you are using the right devkit installer for your version of Ruby. The documentation at devkit wiki page has a requirements note saying:
For RubyInstaller versions 1.8.7, 1.9.2, and 1.9.3 use the DevKit
4.5.2
I have found that the error is sometimes caused by a missing library.
so If you install RDOC first
by running
gem install rdoc
then install rails with:
gem install rails
then go back and install the devtools as mentioned before with:
1) Extract DevKit to path C:\Ruby193\DevKit
2) cd C:\Ruby192\DevKit
3) ruby dk.rb init
4) ruby dk.rb review
5) ruby dk.rb install
then try installing json
which culminate with you finally being able to run
rails new project_name - without errors.
good luck
Followed the steps.
Extract DevKit to path C:\Ruby193\DevKit
cd C:\Ruby192\DevKit
ruby dk.rb init
ruby dk.rb review
ruby dk.rb install
Then I wrote the command
gem install rails -r -y
1) Download Ruby 1.9.3
2) cmd check command: ruby -v 'return result ruby 1.9.3 then success full install ruby
3) Download DevKit file from http://rubyinstaller.org/downloads (DevKit-tdm-32-4.5.2-20110712-1620-sfx.exe)
4) Extract DevKit to path C:\Ruby193\DevKit
5) cd C:\Ruby193\DevKit
6) ruby dk.rb init
7) ruby dk.rb review
8) ruby dk.rb install
9) cmd : gem install rails -v3.1.1 'few time installing full process'
10) cmd : rails -v 'return result rails 3.1.1 then its success fully install'
enjoy Ruby on Rails...
I would like to add that you should make sure that the generated config.yml file when doing ruby dk.rb init contains the path to the ruby installation you want to use DevKit with. In my case, I had the Heroku Toolbelt installed on my system, which provided its own ruby installation, located at a different place. The config.yml file used that particular installation, and that's not what I wanted. I had to manually edit the file to point it to the correct one, then continue with ruby dk.rb review, etc.
My solution is simplier and checked on Ruby 2.0. It also enable download Json. (run CMD.exe as administrator)
C:\RubyDev>devkitvars.bat
Adding the DevKit to PATH...
And then write again gem command.
My gem version 2.0.3 and I was getting the same issue.
This command resolved it:
gem install json --platform=ruby --verbose