Reputation: 27222
I'm here on Windows 7 x64 and am trying to install Ruby on Rails from scratch. I just installed the RubyInstaller 1.9.3-p429
and now just ran the DevKit-tdm-32-4.5.2-20111229-1559-sfx
. After doing ruby dk.rb install --force
. I tried to test if it's setup correctly but run into:
c:\DevKit>gem install RedCloth --platform=ruby
Temporarily enhancing PATH to include DevKit...
Building native extensions. This could take a while...
The system cannot find the path specified.
ERROR: Error installing RedCloth:
ERROR: Failed to build gem native extension.
C:/Ruby193/bin/ruby.exe extconf.rb
checking for main() in -lc... no
creating Makefile
Gem files will remain installed in C:/Ruby193/lib/ruby/gems/1.9.1/gems/RedCloth-4.2.9 for inspection.
Results logged to C:/Ruby193/lib/ruby/gems/1.9.1/gems/RedCloth-4.2.9/ext/redcloth_scan/gem_make.out
And this happens to all gems that need the Devkit. I guess I have to set the path specified but I have no idea what that means. How do I do that or what's the real problem here?
P.S.
A little bit of background. I did have RailsInstaller installed but I was getting the same error so I deleted everything. I also had NodeJs installed as well but deleted that too. I erased the PATH variables completely to start from scratch.
UPDATE
Trying the RailsInstaller gives me this error:
$ gem install json -v 1.8.0
Temporarily enhancing PATH to include DevKit...
Building native extensions. This could take a while...
The system cannot find the path specified.
ERROR: Error installing json:
ERROR: Failed to build gem native extension.
c:/RailsInstaller/Ruby1.9.3/bin/ruby.exe extconf.rb
creating Makefile
Gem files will remain installed in c:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/json-1.8.0 for inspection.
Results logged to c:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/json-1.8.0/ext/json/ext/generator/gem_make.out
Upvotes: 3
Views: 9567
Reputation: 1952
That details a couple scenarios that can cause this problem. Just in case the link dies, though. The first is where your COMSPEC system variable no longer has a full path to cmd.exe. The second is where some kind of autorun is in the registry--this is where you check:
REG QUERY "HKCU\Software\Microsoft\Command Processor" /s
REG QUERY "HKLM\Software\Microsoft\Command Processor" /s
REG QUERY "HKCU\Software\Wow6432Node\Microsoft\Command Processor" /s
REG QUERY "HKLM\Software\Wow6432Node\Microsoft\Command Processor" /s
And if you see any autoruns you delete them with something like:
REG DELETE "HKCU\Software\Microsoft\Command Processor" /v AutoRun
Upvotes: 0
Reputation: 122
I had this issue, Windows 8 x64, Ruby 2.2.3.
I tried everything from many posts and many answers but only this worked for me: Deleting old devkits and installing again.
I got it working after these steps:
Delete every folder you have ever installed devkit
Install (x64 - 64bits only) DevKit-mingw64-64-4.7.2-20130224-1432-sfx.exe from http://rubyinstaller.org/downloads/
Execute and install somewhere without spaces or anything on the path (I did c:\devkit)
Go to your system environments and add to the path c:\devkit and c:\devkit\bin
Open a CMD prompt as an admin, go to c:\devkit and type:
ruby dk.rb init
ruby dk.rb install --force
Upvotes: 0
Reputation: 111
I hate to bump an old thread, but I wish to add to the answers just in case someone else comes by (likely as this is at the top of a Google search for a "Devkit PATH error").
After extracting the DevKit into a permanent directory and after you've navigated to the install folder within your shell and entered the "ruby dk.rb init" command, make sure you actually do the next step and install the devkit. After the init command, run "ruby dk.rb install" and that should fix many similar problems.
Upvotes: 10
Reputation: 894
The best that has worked for me always in these errors is: https://github.com/oneclick/rubyinstaller/wiki/Troubleshooting#wiki-gems_fails_comspec_autorun
If you installed the devkit as per standard guidelines on https://github.com/oneclick/rubyinstaller/wiki/Development-Kit#installation-instructions, then it's not the Devkit path but the incorrect Autorun regex key OR the incorrect command processor set by other tools that interferes with ruby gem installations. Give it a go.
Upvotes: 1
Reputation: 81
I was facing the excact same problem when I tried to install Cucumber until I tried using the --verbose
parameter. For some reasons this worked out for me but I cannot really explain why. I am not considering it as a solution but it is worth a try.
Upvotes: 2
Reputation: 35531
You need to include the Devkit/bin directory in your environment path. First, find out where Devkit was installed. For this example, we'll presume it's at C:\Devkit
.
Next open your Advanced System Settings (accessible under MyComputer => Properties), and click the Environment Variables button. Under the 'user variables' section, edit the 'Path' entry to include C:\Devkit\bin
. Note that this entry is semicolon delimited so you'll need to add a trailing (or prepending) semicolon to this string.
Upvotes: 4