Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Failed to build gem native extension - extconf.rb not found

When trying to install

'bcrypt-ruby', :lib => 'bcrypt'

and

'hpricot'

I get this in both cases (Using Windows XP)

C:/Ruby/bin/ruby.exe: No such file or directory -- extconf.rb (LoadError)

I installed from here http://rubyinstaller.org/downloads/ Rb 1.8.6, including the devkit

any hints?, thanks

like image 591
george Avatar asked Dec 22 '22 02:12

george


1 Answers

There's now an entry in the RubyInstaller Wiki that addresses this potential issue:

Using a command prompt, invoke the following commands:

REG QUERY "HKCU\Software\Microsoft\Command Processor"
REG QUERY "HKLM\Software\Microsoft\Command Processor"

Execute each line individually. Once you run it, will see something like this:

HKEY_CURRENT_USER\Software\Microsoft\Command Processor
    CompletionChar    REG_DWORD    0x9
    DefaultColor    REG_DWORD    0x0
    EnableExtensions    REG_DWORD    0x1
    PathCompletionChar    REG_DWORD    0x9

The columns of information are Key, Type and Value. If you see a key named AutoRun, there is a chance this is the culprit of the error you’re receiving. AutoRun interferes with Ruby messing with child process executing and by result, affecting gem installation. Please remove it with the following command:

REG DELETE "HKCU\Software\Microsoft\Command Processor" /v AutoRun

Once you’re done, try opening a new command prompt and executing gem installation again.

like image 61
Ryan Barton Avatar answered Jan 17 '23 14:01

Ryan Barton