Cannot install a gem on Windows x64

Hi,

I am trying to install CUBRID Database Driver through “gem install
cubrid” on my Windows x64 machine.

  1. I have installed CUBRID 3.0 x64.
  2. Ruby 1.8.7-p302 from Downloads
  3. DevKit-3.4.5-20100819-1535-sfx.exe from
    Downloads

In the gem’s extconf.rb, there is a line which checks if there is a
“cascci” library like “if have_library(“cascci”, “cci_init”)”. The path
to cascci library is correctly set in “C:/CUBRID/lib”, include files are
in “C:/CUBRID/include”.

However, when I install cubrid gem using “gem install cubrid”, or when I
compile it using “ruby extconf.rb” I got the following error:

checking for cci_init() in -lcascci… no
cascci could not be found. Either you have not installed CUBRID Database
yet or the path to CUBRID is not set.
*** extconf.rb failed ***
Could not create Makefile due to some reason, probably lack of
necessary libraries and/or headers. Check the mkmf.log file for more
details. You may need configuration options.

have_library: checking for cci_init() in -lcascci… --------- no

"gcc -o conftest -I. -IC:/Ruby/lib/ruby/1.8/i386-mingw32 -I.
-IC:/CUBRID/include -g -O2 -DFD_SETSIZE=256 conftest.c -L.
-LC:/Ruby/lib -LC:/CUBRID/lib -L. -lmsvcrt-ruby18-static -lcascci
-lshell32 -lws2_32 "
checked program was:
/* begin /
1: #include <ws2tcpip.h>
2: #include <winsock2.h>
3: #include <windows.h>
4:
5: /top/
6: int main() { return 0; }
7: int t() { void ((volatile p)()); p = (void (()()))cci_init; return
0; }
/
end */

"gcc -o conftest -I. -IC:/Ruby/lib/ruby/1.8/i386-mingw32 -I.
-IC:/CUBRID/include -g -O2 -DFD_SETSIZE=256 conftest.c -L.
-LC:/Ruby/lib -LC:/CUBRID/lib -L. -lmsvcrt-ruby18-static -lcascci
-lshell32 -lws2_32 "
checked program was:
/* begin /
1: /top/
2: int main() { return 0; }
3: int t() { cci_init(); return 0; }
/
end */

I checked the path, it is correct, CUBRID is installed. I have
successfully installed both through gem and through manual compilation
the same cubrid gem on Windows 32 bit. But on x64 it fails.

How should I compile the gem under Windows x64? Should I have some
libraries for it? Why rubygem cannot find the library in x64? I suppose
some flags should be present to indicate that this is x64 machine. Or is
there anything else I should know?

Any help would be highly appreciated. Thank you in advance!

On Oct 13, 7:11am, Esen S. [email protected] wrote:

“cascci” library like “if have_library(“cascci”, “cci_init”)”. The path
to cascci library is correctly set in “C:/CUBRID/lib”, include files are
in “C:/CUBRID/include”.

seems you have tried --with-cascci-lib=C:/CUBRID/lib --with-cascci-
include=C:/CUBRID/include

However, when I install cubrid gem using “gem install cubrid”, or when I
compile it using “ruby extconf.rb” I got the following error:

Did you provide the above parameters?

When calling ruby extconf.rb, you can do them directly. When doing
with the gem, you need separate them with –

gem install cubrid – --with-cascci-lib=C:/CUBRID/lib --with-cascci-
include=C:/CUBRID/include

have_library: checking for cci_init() in -lcascci… --------- no

I checked the path, it is correct, CUBRID is installed. I have
successfully installed both through gem and through manual compilation
the same cubrid gem on Windows 32 bit. But on x64 it fails.

Are you sure are supplying these parameters to the gem installation?

How should I compile the gem under Windows x64? Should I have some
libraries for it? Why rubygem cannot find the library in x64? I suppose
some flags should be present to indicate that this is x64 machine. Or is
there anything else I should know?

No, Ruby is 32bits, you don’t need a 64bits cubrid library because is
not going to work (32bits Ruby needs 32bits libraries)

Any help would be highly appreciated. Thank you in advance!

Something I noticed is that CUBRID libraries were compiled with newer
Visual C runtime libraries. That might have issues (or not, since
haven’t installed it to test).

Please test the above suggestions for command line and let us know.

There should be no issue under x64 unless you installed CUBRID 64bits.

On Oct 13, 7:11am, Esen S. [email protected] wrote:

Hi,

I am trying to install CUBRID Database Driver through “gem install
cubrid” on my Windows x64 machine.

  1. I have installed CUBRID 3.0 x64.
  2. Ruby 1.8.7-p302 fromhttp://rubyinstaller.org/downloads/
  3. DevKit-3.4.5-20100819-1535-sfx.exe fromhttp://rubyinstaller.org/downloads/

On my previous response I missed this:

You have CUBRID x64 installed. But Ruby is 32bits. That will not work.
You can’t mix 32bits Ruby with 64bits libraries.

You need CUBRID 32bits libraries to compile against.

Luis L. wrote in post #949880:

seems you have tried --with-cascci-lib=C:/CUBRID/lib --with-cascci-
include=C:/CUBRID/include
Did you provide the above parameters?

I did. In fact, extconf.rb automatically includes the path. But I tried
manually as well.

When calling ruby extconf.rb, you can do them directly. When doing
with the gem, you need separate them with –
gem install cubrid – --with-cascci-lib=C:/CUBRID/lib --with-cascci-
include=C:/CUBRID/include

I have just tried this, but the same error:
“checking for cci_init() in -lcascci… no”.
I don’t understand, Ruby should at least see the library. If x64
compiled library is the problem, it should see it and say “not
compatible” or “not Win32” at least. But Ruby cannot find the library at
all.

Are you sure are supplying these parameters to the gem installation?

Absolutely.

No, Ruby is 32bits, you don’t need a 64bits cubrid library because is
not going to work (32bits Ruby needs 32bits libraries)

It’s good to know this for sure.

Something I noticed is that CUBRID libraries were compiled with newer
Visual C runtime libraries. That might have issues (or not, since
haven’t installed it to test).

For building CUBRID on Windows, Visual Studio 2008 is used. I am not
sure about Ruby. I wonder how did you “noticed is that CUBRID libraries
were compiled with newer Visual C runtime libraries”? How is it possible
to notice?

Luis L. wrote in post #949882:

You have CUBRID x64 installed. But Ruby is 32bits. That will not work.
You can’t mix 32bits Ruby with 64bits libraries.
You need CUBRID 32bits libraries to compile against.

If so, how users use MySQL x64 with Ruby? I heard many cases downloading
third-party x64 compiled libmysql and successfully using it with Ruby.
So how is that possible if Ruby SHOULD NEVER work with x64 compiled
libraries? What about on Linux x64 with MySQL x64 and Ruby installed? It
just does not make any sense to me.

On Oct 13, 10:28pm, Esen S. [email protected] wrote:

http://www.cubrid.org/windows_downloads

Under “Software Requirements for CUBRID Manager”: MS Visual C++ 2008
Redistributable Package

That is a hint that it depends on newer MSVCRT library (MSVCR80.DLL
actually)

just does not make any sense to me.

Simple: you can install MySQL x64, but you need a 32bits libmysql.dll
in your Ruby\bin directory. That is what Ruby mysql extension uses and
then it can communicate with a local or remote 32/64 bits MySQL, that
is not a problem.

Now, if you need to build the extension (which is something you’re
doing), then you need a 32bits MySQL to be able to compile against.

To our bad, Windows lack the concept of universal binaries that can
provide in the same DLL both 32 and 64 bits linking.

And I know is too much to say this but trust me, I kind of know what
is involved in this 32/64 bits and specially the MySQL subject.