Compilation errors building ruby-odbc on Windows 7 64bit with Ruby 1.9.3

143 views
Skip to first unread message

Matthew Cummings

unread,
Apr 13, 2015, 11:49:13 PM4/13/15
to rubyin...@googlegroups.com
I just posted to this group but it doesn't appear to have gone through, hopefully this one will. I need to connect to a SQL Server database from Ruby on Windows and need to install the dbi gem, which depends on the ruby-odbc gem.  I only found the 32bit version of the DevKit for Ruby 1.9.3 but I was able to install it and compile the json example per https://github.com/oneclick/rubyinstaller/wiki/Development-Kit.

Here are my configs: 
Windows 7 64 bit
ruby 1.9.3p551 (2014-11-13) [i386-mingw32]
rubygems 1.8.29 first, then I updated it to 2.4.6
I have installed the DevKit, the 32bit version for Ruby 1.9.3: DevKit-tdm-32-4.5.2-20111229-1559-sfx.exe
gem install ruby-odbc
gist with the errors/logs: https://gist.github.com/matthewcummings/5e2be714441cbea325fa  The gist does not contain the contents of mkmf.log with rubygems 1.8.29, only with rubygems 2.4.6.  It does the console output with both versions of rubygems though.

Any help is appreciated, thank you.

Justin Baker

unread,
Apr 14, 2015, 12:15:17 AM4/14/15
to rubyin...@googlegroups.com
Hey, sorry about your first post, see inline responses below.

On Monday, April 13, 2015 at 10:49:13 PM UTC-5, Matthew Cummings wrote:
I just posted to this group but it doesn't appear to have gone through, hopefully this on will. I need to connect to a SQL Server database from Ruby on Windows and need to install the dbi gem, which depends on the ruby-odbc gem.  I only found the 32bit version of the DevKit for Ruby 1.9.3 but I was able to install it and compile the json example per https://github.com/oneclick/rubyinstaller/wiki/Development-Kit.

It looks like the DevKit is working. But I don't know much about the ruby-odbc gem.
 
Here are my configs: 
Windows 7 64 bit
ruby 1.9.3p551 (2014-11-13) [i386-mingw32]
rubygems 1.8.29 first, then I updated it to 2.4.6

There are problems with Ruby 1.9.3 and more recent versions of rubygems.
Downgrade to rubygems 1.8.30

More Info:
 
I have installed the DevKit, the 32bit version for Ruby 1.9.3: DevKit-tdm-32-4.5.2-20111229-1559-sfx.exe
gem install ruby-odbc
gist with the errors/logs: https://gist.github.com/matthewcummings/5e2be714441cbea325fa  The gist does not contain the contents of mkmf.log with rubygems 1.8.29, only with rubygems 2.4.6.  It does the console output with both versions of rubygems though.

So yeah, looking through the  logs it looks like you're missing some kind of header. I don't know which one or where to get it though.
If you could downgrade and get some logs with a rubygems version that doesn't cause weird make errors we can get some more info.
I have a feeling that we are going to have to contact the gem author to figure what dependencies we need to grab though.

Justin

Matthew Cummings

unread,
Apr 14, 2015, 12:38:17 AM4/14/15
to rubyin...@googlegroups.com
Thanks for response Justin.  I downgraded to rubygems 1.8.30 and re-ran the gem install command.  

The new output is in this gist:

That's what I was thinking about the header files too.  I'll send an email to the gem author now.

Matt


--
You received this message because you are subscribed to a topic in the Google Groups "RubyInstaller" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/rubyinstaller/MHe0WQ9iqmk/unsubscribe.
To unsubscribe from this group and all its topics, send an email to rubyinstalle...@googlegroups.com.
To post to this group, send email to rubyin...@googlegroups.com.
Visit this group at http://groups.google.com/group/rubyinstaller.
For more options, visit https://groups.google.com/d/optout.

Matthew Cummings

unread,
Apr 14, 2015, 7:53:20 PM4/14/15
to rubyin...@googlegroups.com
BTW, I heard back from the gem author, apparently there's a typo in one of the source files, his words:
"there slipped in a typo: replace SQLFOREGINKEYS with SQLFOREIGNKEYS globally
in .../ext/odbc.c and you should be fine."
That fix didn't actually work for me, however I'm going to try using Ruby 2.1.5 and see if I can get everything to work correctly.  Earlier today, I was able to gem install both dbi and ruby-odbc with that version of Ruby.  It looks like my team is OK with upgrading Ruby.
To unsubscribe from this group and all its topics, send an email to rubyinstaller+unsubscribe@googlegroups.com.

Justin Baker

unread,
Apr 14, 2015, 8:07:40 PM4/14/15
to rubyin...@googlegroups.com
Cool, thanks for the update Matt.

Let me know if you get everything working. That way if other people ask I can refer to this thread.
Since 1.9.3 reached it's EoL it's not surprising that authors may not target that version for gem compatibility anymore.

If you need anything else feel free to ask.

Justin

Matthew Cummings

unread,
Apr 14, 2015, 8:12:00 PM4/14/15
to rubyin...@googlegroups.com
Awesome, thanks for the help.  Yeah, I've generally moved over to 2.1.5 myself but for this project I had some requirements (which have been lifted!) to stick with 1.9.3.


--
You received this message because you are subscribed to a topic in the Google Groups "RubyInstaller" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/rubyinstaller/MHe0WQ9iqmk/unsubscribe.
To unsubscribe from this group and all its topics, send an email to rubyinstalle...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages