# Cannot install a gem on Windows x64

**URL:** <https://www.ruby-forum.com/t/cannot-install-a-gem-on-windows-x64/197366>\
**Category:** Ruby\
**Created:** [October 13, 2010, 12:10pm UTC](https://www.ruby-forum.com/t/cannot-install-a-gem-on-windows-x64/197366 "2010-10-13T12:10:52Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Dobai-Pataky\_BSSSSl](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/77aa72/32.png) [@Dobai-Pataky\_BSSSSl](https://www.ruby-forum.com/u/Dobai-Pataky_BSSSSl)\
**Post date:** [October 13, 2010, 12:10pm UTC](https://www.ruby-forum.com/t/cannot-install-a-gem-on-windows-x64/197366/1 "2010-10-13T12:10:52Z")

</div>

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](http://rubyinstaller.org/downloads/)
3. DevKit-3.4.5-20100819-1535-sfx.exe from  
[Downloads](http://rubyinstaller.org/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!

---

<div class="post-metadata">

**Author:** ![kadishmal](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/k/87869e/32.png) [@kadishmal](https://www.ruby-forum.com/u/kadishmal)\
**Post date:** [October 13, 2010, 5:21pm UTC](https://www.ruby-forum.com/t/cannot-install-a-gem-on-windows-x64/197366/2 "2010-10-13T17:21:11Z")

</div>

On Oct 13, 7:11am, Esen S. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) 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.

---

<div class="post-metadata">

**Author:** ![kadishmal](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/k/87869e/32.png) [@kadishmal](https://www.ruby-forum.com/u/kadishmal)\
**Post date:** [October 13, 2010, 5:26pm UTC](https://www.ruby-forum.com/t/cannot-install-a-gem-on-windows-x64/197366/3 "2010-10-13T17:26:12Z")

</div>

On Oct 13, 7:11am, Esen S. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) 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.

---

<div class="post-metadata">

**Author:** ![kadishmal](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/k/87869e/32.png) [@kadishmal](https://www.ruby-forum.com/u/kadishmal)\
**Post date:** [October 14, 2010, 3:20am UTC](https://www.ruby-forum.com/t/cannot-install-a-gem-on-windows-x64/197366/4 "2010-10-14T03:20:56Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![kadishmal](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/k/87869e/32.png) [@kadishmal](https://www.ruby-forum.com/u/kadishmal)\
**Post date:** [October 14, 2010, 3:26pm UTC](https://www.ruby-forum.com/t/cannot-install-a-gem-on-windows-x64/197366/5 "2010-10-14T15:26:09Z")

</div>

On Oct 13, 10:28pm, Esen S. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> 

[http://www.cubrid.org/windows\_downloads](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.
