Json gem problem

209 views
Skip to first unread message

Charles Roper

unread,
Oct 9, 2009, 12:08:44 PM10/9/09
to rubyin...@googlegroups.com
Has anyone else managed to install the json gem lately? When I try I get this:

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

C:/Ruby/bin/ruby.exe extconf.rb
checking for ruby/st.h... no
checking for st.h... yes
checking for ruby/encoding.h... no
creating Makefile

make
make: *** No rule to make target `ruby.h', needed by `generator.o'. Stop.


Gem files will remain installed in
C:/Ruby/lib/ruby/gems/1.8/gems/json-1.1.9 for inspection.
Results logged to
C:/Ruby/lib/ruby/gems/1.8/gems/json-1.1.9/ext/json/ext/generator/gem_make.out

What's going on there? Have I got a problem with my devkit?

Cheers,
Charles

Luis Lavena

unread,
Oct 9, 2009, 12:16:12 PM10/9/09
to rubyin...@googlegroups.com

Looks like you have. Search the archives for gcc batch script fixes or check my binfiles repository at github.

Sent from mobile.

Charles Roper

unread,
Oct 9, 2009, 12:21:34 PM10/9/09
to rubyin...@googlegroups.com
Hrm, weird. If I start Ruby from the shortcut installed by the
installer (ruby 1.8.6 (2009-08-04 patchlevel 383) [i386-mingw32]),
then it installs. But if I start my console normally, it doesn't.

What might be causing that?

Thanks for the suggestion Luis, I'll have a hunt around.

Charles

2009/10/9 Luis Lavena <luisl...@gmail.com>:

Charles Roper

unread,
Oct 9, 2009, 12:27:11 PM10/9/09
to rubyin...@googlegroups.com
And if I run setrbvars.bat, then that also makes it work. So I have an
issue with my path. Any ideas as to what could be wrong?

2009/10/9 Charles Roper <charle...@gmail.com>:

Luis Lavena

unread,
Oct 9, 2009, 12:32:15 PM10/9/09
to rubyin...@googlegroups.com

Hehehe, post your PATH,I will check.

Sent from mobile.

On Oct 9, 2009 6:27 PM, "Charles Roper" <charle...@gmail.com> wrote:


And if I run setrbvars.bat, then that also makes it work. So I have an
issue with my path. Any ideas as to what could be wrong?

2009/10/9 Charles Roper <charle...@gmail.com>:

> Hrm, weird. If I start Ruby from the shortcut installed by the > installer (ruby 1.8.6 (2009-08-04...

Charles Roper

unread,
Oct 9, 2009, 12:47:48 PM10/9/09
to rubyin...@googlegroups.com
2009/10/9 Luis Lavena <luisl...@gmail.com>:

> Hehehe, post your PATH,I will check.

It's a long one:

Path=c:\program
files\imagemagick-6.4.5-q8;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\Program
Files\Common Files\Roxio Shared\DLLShared\;C:\Program Files\Common
Files\Roxio Shared\9.0\DLLShared\;C:\Program Files\Bitvise
Tunnelier;C:\Program Files\Microsoft SQL
Server\80\Tools\Binn\;C:\Program Files\Microsoft SQL
Server\90\Tools\binn\;C:\Program Files\Microsoft SQL
Server\90\DTS\Binn\;C:\Program Files\Microsoft SQL
Server\90\Tools\Binn\VSShell\Common7\IDE\;C:\Program Files\Microsoft
Visual Studio 8\Common7\IDE\PrivateAssemblies\;C:\Program
Files\e\cmd;C:\WINDOWS\system32\WindowsPowerShell\v1.0;C:\usr\local\wbin;C:\bin;C:\Program
Files\QuickTime\QTSystem\;C:\Program Files\Git\cmd;C:\Program
Files\Git\bin;C:\Program Files\TortoiseGit\bin;C:\Program
Files\TortoiseHg;H:\My Dropbox\Software\Locate32;C:\Ruby\bin

Cheers Luis.

Charles

Luis Lavena

unread,
Oct 9, 2009, 1:08:45 PM10/9/09
to RubyInstaller
On Oct 9, 6:47 pm, Charles Roper <charles.ro...@gmail.com> wrote:
> 2009/10/9 Luis Lavena <luislav...@gmail.com>:
>
> > Hehehe, post your PATH,I will check.
>
> It's a long one:
>
> Path=c:\program
> files\imagemagick-6.4.5-q8;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System 32\Wbem;C:\Program
> Files\Common Files\Roxio Shared\DLLShared\;C:\Program Files\Common
> Files\Roxio Shared\9.0\DLLShared\;C:\Program Files\Bitvise
> Tunnelier;C:\Program Files\Microsoft SQL
> Server\80\Tools\Binn\;C:\Program Files\Microsoft SQL
> Server\90\Tools\binn\;C:\Program Files\Microsoft SQL
> Server\90\DTS\Binn\;C:\Program Files\Microsoft SQL
> Server\90\Tools\Binn\VSShell\Common7\IDE\;C:\Program Files\Microsoft
> Visual Studio 8\Common7\IDE\PrivateAssemblies\;C:\Program
> Files\e\cmd;C:\WINDOWS\system32\WindowsPowerShell\v1.0;C:\usr\local\wbin;C: \bin;C:\Program
> Files\QuickTime\QTSystem\;C:\Program Files\Git\cmd;C:\Program
> Files\Git\bin;C:\Program Files\TortoiseGit\bin;C:\Program
> Files\TortoiseHg;H:\My Dropbox\Software\Locate32;C:\Ruby\bin
>

Smelly things:

C:\usr\local\wbin
C:\bin
C:\Program Files\Git\bin
C:\Program Files\Git\cmd

If you can use a which or where finder, search for "gcc", "make" and
"sh" that could be in the PATH.

Since your C:\Ruby\bin is last, something in the previous paths is
interfering.

Cheers,
--
Luis Lavena

Charles Roper

unread,
Oct 9, 2009, 2:01:40 PM10/9/09
to rubyin...@googlegroups.com
2009/10/9 Luis Lavena <luisl...@gmail.com>:

> Smelly things:
>
> C:\usr\local\wbin
> C:\bin
> C:\Program Files\Git\bin
> C:\Program Files\Git\cmd
>
> If you can use a which or where finder, search for "gcc", "make" and
> "sh" that could be in the PATH.

C:\>which make.bat && which gcc.bat && which sh.bat
C:\Ruby\bin\make.bat
C:\Ruby\bin\gcc.bat
C:\Ruby\bin\sh.bat

If the ruby path is added to the beginning of my path, it works. I'll
look into this further over the weekend perhaps.

Thanks Luis.

Charles

rogerdpack

unread,
Oct 9, 2009, 3:15:03 PM10/9/09
to RubyInstaller
> C:\>which make.bat && which gcc.bat && which sh.bat
> C:\Ruby\bin\make.bat
> C:\Ruby\bin\gcc.bat
> C:\Ruby\bin\sh.bat
>
> If the ruby path is added to the beginning of my path, it works. I'll
> look into this further over the weekend perhaps.

It's possible another sh is getting in the way.
You can search more easily with whichr :)

(shameless self promo)

C:\dev\blade_copy\digitalarchive_trunk>gem install rogerdpack-whichr
Successfully installed rogerdpack-whichr-0.1.5
1 gem installed

C:\dev\blade_copy\digitalarchive_trunk>whichr bash
C:/Program Files/Git/bin/bash.exe
c:/cygwin/bin/bash.exe

Luis Lavena

unread,
Oct 9, 2009, 8:53:24 PM10/9/09
to RubyInstaller
On Oct 9, 8:01 pm, Charles Roper <charles.ro...@gmail.com> wrote:
> 2009/10/9 Luis Lavena <luislav...@gmail.com>:
>
> > Smelly things:
>
> > C:\usr\local\wbin
> > C:\bin
> > C:\Program Files\Git\bin
> > C:\Program Files\Git\cmd
>
> > If you can use a which or where finder, search for "gcc", "make" and
> > "sh" that could be in the PATH.
>
> C:\>which make.bat && which gcc.bat && which sh.bat
> C:\Ruby\bin\make.bat
> C:\Ruby\bin\gcc.bat
> C:\Ruby\bin\sh.bat
>
> If the ruby path is added to the beginning of my path, it works. I'll
> look into this further over the weekend perhaps.
>

The problem is that you could have sh.exe, gcc.exe and make.exe, not
batch files.

The DevKit batch files are to avoid pollute the PATH adding both MSYS
and MinGW to it.

Please do which for gcc, make and sh without extension.

C:\Users\Luis>where sh
C:\Users\Luis\Tools\bin\sh.bat

C:\Users\Luis>where gcc
C:\Users\Luis\Tools\bin\gcc.bat

C:\Users\Luis>full-mingw

C:\Users\Luis>where sh
C:\Users\Luis\Tools\MinGW\msys\bin\sh.exe
C:\Users\Luis\Tools\bin\sh.bat

C:\Users\Luis>where gcc
C:\Users\Luis\Tools\MinGW\gcc\bin\gcc.exe
C:\Users\Luis\Tools\bin\gcc.bat

where is a Windows7 tool, but something similar is available to you
(which) -- which means you have MSYS in your PATH, and based on your
full PATH, looks like you have it before Ruby wrappers, so most likely
you have sh and thus, configure is going to fail.

If putting Ruby at the beginning fixes is, is clearly what I mention
before.

--
Luis Lavena

Charles Roper

unread,
Oct 10, 2009, 5:56:53 AM10/10/09
to rubyin...@googlegroups.com
On 10/10/2009 01:53, Luis Lavena wrote:
> The problem is that you could have sh.exe, gcc.exe and make.exe, not
> batch files.

Yeah, I thought of that once I had got home (the problems were on my
work PC), and now I don't have access to my work PC until Monday. Sigh.

Thing is, I tried using which on sh, gcc and make without the extensions
and it returned nothing, which is what lead me to looking for the bat
files. I didn't think of looking for .exe files at the time; I'm sure
I'll turn up the culprits when I do.

Roger, sounds like your whichr would have found what I was looking for.
Have you considered adding it to Gemcutter?

I'll let you guys know what the answer to this thrilling mystery turned
out to be on Monday. Betcha can't wait, huh?

Is the final RubyInstaller going to sort out the PATH for you? I see you
guys have been having lengthy conversations (which I admit I haven't
been following) about it.

Cheers,
Charles

Jon

unread,
Oct 10, 2009, 11:59:06 AM10/10/09
to RubyInstaller
> Is the final RubyInstaller going to sort out the PATH for you? I see you
> guys have been having lengthy conversations (which I admit I haven't
> been following) about it.
>
> Cheers,
> Charles

The current plan is that the upcoming RC1 RubyInstaller will sort out
PATH, PATHEXT, and file extensions for you *only* if you select those
options from the installer GUI at install time.

Given the corner cases, this is a bit more challenging to get right
that you'd would think.

That's why I've created the fake installers in the hopes that the more
of us that run them through the gauntlet, the better chances we'll
have of getting it right for RC1 and Final.

Skip over those lengthy conversations and go right for testing out the
fake installers at:

http://www.mediafire.com/?sharekey=85c8079476fedaa68ef1259ff1b60e81e04e75f6e8ebb871

Thanks in advance for any installer testing...let us know if you find
problems.

Jon

Charles Roper

unread,
Oct 11, 2009, 5:36:24 PM10/11/09
to rubyin...@googlegroups.com
Jon, will definitely give the fake installers a whirl - I think it'll
be a good test seeing as my XP work machine has such a crufty path.
Will try to give it some attention on Monday.

Cheers,
Charles

2009/10/10 Jon <jon.f...@gmail.com>:

Jon

unread,
Oct 12, 2009, 9:50:01 AM10/12/09
to rubyin...@googlegroups.com
> Jon, will definitely give the fake installers a whirl - I think it'll
> be a good test seeing as my XP work machine has such a crufty path.
> Will try to give it some attention on Monday.
>
> Cheers,
> Charles

Great, and thanks!

I'm anxious to see how well the updated PATH and PATHEXT code works in the wild as these registry changing things tend to cause more than there share of bug reports if the installer makes a bunch of bad assumptions.

Jon

Charles Roper

unread,
Oct 13, 2009, 2:00:16 PM10/13/09
to rubyin...@googlegroups.com
2009/10/12 Jon <jon.f...@gmail.com>:

> I'm anxious to see how well the updated PATH and PATHEXT code works in the wild as these registry changing things tend to cause more than there share of bug reports if the installer makes a bunch of bad assumptions.

1.8.6 seems to have installed fine. Here's my path post-install:

C:\FakeRuby18\bin;C:\Ruby\bin;c:\program
files\imagemagick-6.4.5-q8;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\Program


Files\Common Files\Roxio Shared\DLLShared\;C:\Program Files\Common
Files\Roxio Shared\9.0\DLLShared\;C:\Program Files\Bitvise
Tunnelier;C:\Program Files\Microsoft SQL
Server\80\Tools\Binn\;C:\Program Files\Microsoft SQL
Server\90\Tools\binn\;C:\Program Files\Microsoft SQL
Server\90\DTS\Binn\;C:\Program Files\Microsoft SQL
Server\90\Tools\Binn\VSShell\Common7\IDE\;C:\Program Files\Microsoft
Visual Studio 8\Common7\IDE\PrivateAssemblies\;C:\Program

Files\e\cmd;C:\WINDOWS\system32\WindowsPowerShell\v1.0;C:\usr\local\wbin;C:\bin;C:\Program
Files\QuickTime\QTSystem\;C:\Program Files\Git\cmd;C:\Program


Files\Git\bin;C:\Program Files\TortoiseGit\bin;C:\Program
Files\TortoiseHg

Here's PATHEXT:

.COM;.EXE;.BAT;.CMD;.VBS;.VBE;.JS;.JSE;.WSF;.WSH;.PSC1;.RB;.RBW

Also,

> which sh.exe
C:\bin\sh.exe

Erm, I've no idea what that is doing there. It's gone now. Ahem. Smelly indeed.

> which make.exe
C:\usr\local\wbin\make.exe

That's now gone too. How I manage to get this cruft into my system
I'll never know!

Cheers guys.

Charles

Charles Roper

unread,
Oct 13, 2009, 2:12:05 PM10/13/09
to rubyin...@googlegroups.com
2009/10/13 Charles Roper <charle...@gmail.com>:

> 2009/10/12 Jon <jon.f...@gmail.com>:
>> I'm anxious to see how well the updated PATH and PATHEXT code works in the wild as these registry changing things tend to cause more than there share of bug reports if the installer makes a bunch of bad assumptions.

Just a quick followup:

Uninstalling the fake installer successfully removed the fakeinstaller
reference from the PATH and also removed the references in PATHEXT.

Note, when I installed the new PATH didn't seem to kick in after
installing - I guess I would have needed to log-out and in again (or
reboot). Is that the expected behaviour?

Charles

Jon

unread,
Oct 14, 2009, 10:37:40 AM10/14/09
to rubyin...@googlegroups.com
> Note, when I installed the new PATH didn't seem to kick in after
> installing - I guess I would have needed to log-out and in again (or
> reboot). Is that the expected behaviour?
>
> Charles

Was this in a newly spawned cmd.exe or an existing cmd.exe that the new PATH didn't kick in? If it's only an existing cmd.exe, I think it's one of the many peculiarities of cmd.exe.

Bottom line, there's nothing in the current code that should require a log-out/log-in or reboot cycle. If either of these are required, we've got a bug to find and fix.

Jon

Jon

unread,
Oct 14, 2009, 2:58:28 PM10/14/09
to rubyin...@googlegroups.com
Thanks for the testing. I made a quick helper rake task for quickly looking at the registry values changed by the installer. If you haven't cloned my installer branch, you can download it via your browser at

http://github.com/jonforums/rubyinstaller/raw/installer/recipes/packager/install_utils.rake


Put it in any directory, and run it like the following at various stages in your installer testing to tell what the installer's done to your registry. Updates as I get time to make them, or feel free to send patches :)

# What tasks exist?

>rake -f install_utils.rake -T
(in C:/Users/Jon/Documents/RubyDev/rubyinstaller-trunk/recipes/packager)
rake installer:reg[step,hive] # List installer registry info


# How do I use it?

>rake -f install_utils.rake installer:reg
(in C:/Users/Jon/Documents/RubyDev/rubyinstaller-trunk/recipes/packager)
usage: rake installer:reg[step,hive]

where 'step' is:
in- check system config before installation
in+ check system config after installation
un check system config after uninstallation

and 'hive' is:
hkcu HKEY_CURRENT_USER hive reference
hklm HKEY_LOCAL_MACHINE hive reference


# Dump registry values before RubyInstaller runs

>rake -f install_utils.rake installer:reg[in-,hkcu]
(in C:/Users/Jon/Documents/RubyDev/rubyinstaller-trunk/recipes/packager)
=== PRE-INSTALL 10/14/2009 14:47:49 ===
HKEY_CURRENT_USER\Software\Classes\.rb => rb_auto_file
ERROR: unable to find registry key or value HKEY_CURRENT_USER\Software\Classes\.rbw
ERROR: unable to find registry key or value HKEY_CURRENT_USER\Software\Classes\RubyFile\shell\open\command
ERROR: unable to find registry key or value HKEY_CURRENT_USER\Software\Classes\RubyFile\DefaultIcon
ERROR: unable to find registry key or value HKEY_CURRENT_USER\Software\Classes\RubyWFile\shell\open\command
ERROR: unable to find registry key or value HKEY_CURRENT_USER\Software\Classes\RubyWFile\DefaultIcon
HKEY_CURRENT_USER's Path => C:\Python26\Scripts;C:\Python26;C:\gnuwin32\wget\bin;C:\gnuwin32\grep\bin;C:\gnuwin32\diff\b
in;C:\gnuwin32\less\bin;C:\gnuwin32\curl\bin;C:\gnuwin32\which\bin;C:\gnuwin32\astyle\bin;C:\subversion\bin;C:\Users\Jon
\Documents\JavaDev\ant\bin;C:\Program Files\Java\jdk1.6.0_16\bin;C:\Users\Jon\Documents\JavaDev\scala\bin;C:\lua\bin;C:\
groovy\bin;c:\gant\bin;C:\Program Files\Wix;C:\ruby19\bin;C:\Users\Jon\Documents\WebDev\appengine;C:\jruby\bin;c:\boo\bi
n;C:\Program Files\Putty;c:\git\cmd;C:\Program Files\Premake
ERROR: unable to find registry key or value HKEY_CURRENT_USER's PATHEXT


Jon

Reply all
Reply to author
Forward
0 new messages