santana / ruby-informix

Ruby library for IBM Informix
http://ruby-informix.rubyforge.org
Other
17 stars 7 forks source link

informix installation with ruby 2.2.4 on window #2

Closed dcharan closed 7 years ago

dcharan commented 8 years ago

Hi Team,

When I execute gem install ruby-informix I am getting the error below. Not sure whats wrong. I have set the informix server.

C:/Ruby22/bin/ruby.exe -r ./siteconf20160418-6020-10d6owb.rb extconf.rb creating Makefile

make "DESTDIR=" clean

make "DESTDIR=" generating informixc-i386-mingw32.def compiling informixc.c In file included from C:\IBM\Informix\Client-SDK/incl/esql/sqlhdr.h:38:0, from informixc.c:1: C:\IBM\Informix\Client-SDK/incl/esql/sqlproto.h:233:40: warning: 'struct ifx_connect_struct' declared inside parameter list [enabled by default] C:\IBM\Informix\Client-SDK/incl/esql/sqlproto.h:233:40: warning: its scope is only this definition or declaration, which is probably not what you want [enabled by default] C:\IBM\Informix\Client-SDK/incl/esql/sqlproto.h:235:40: warning: 'struct ifx_connect_struct' declared inside parameter list [enabled by default] informixc.ec: In function 'rbifx_ext_exception': informixc.ec:195:5: warning: format '%d' expects argument of type 'int', but argument 4 has type 'int4' [-Wformat] informixc.ec:216:3: warning: implicit declaration of function 'stleng' [-Wimplicit-function-declaration] informixc.ec: In function 'rb_slob_initialize': informixc.ec:545:4: warning: format '%X' expects argument of type 'unsigned int', but argument 3 has type 'long int' [-Wformat] informixc.ec: In function 'rb_database_initialize': informixc.ec:1987:3: warning: passing argument 1 of 'ifx_free_conn_user' from incompatible pointer type [enabled by default] In file included from C:\IBM\Informix\Client-SDK/incl/esql/sqlhdr.h:38:0, from informixc.c:1: C:\IBM\Informix\Client-SDK/incl/esql/sqlproto.h:233:14: note: expected 'struct ifx_connectstruct *' but argument is of type 'struct ifx_connt *' informixc.ec:2018:2: error: lvalue required as left operand of assignment informixc.ec:2019:2: error: lvalue required as left operand of assignment informixc.ec:2020:2: error: lvalue required as left operand of assignment informixc.ec:2021:2: error: lvalue required as left operand of assignment informixc.ec:2022:2: error: lvalue required as left operand of assignment informixc.ec:2023:2: error: lvalue required as left operand of assignment make: *\ [informixc.o] Error 1

make failed, exit code 2

dcharan commented 8 years ago

The about issue occurs if you upgrade to Ruby Version > 2.1 or IBM SDK client version > 2.9

santana commented 8 years ago

Hello.

Try compiling it using Visual Studio.

santana commented 8 years ago

Disregard my previous message. It seems that Windows support is broken. Try installing the gem on Linux or Mac OS X.

dcharan commented 8 years ago

@santana it works fine in Linux and Mac OS. unfortunately we cant upgrade to Ruby Version > 2.1 on Windows box.

jasonxia commented 7 years ago

Seems it does not work on Ruby version > 2.1 on MacOS

Building native extensions. This could take a while... ERROR: Error installing ruby-informix: ERROR: Failed to build gem native extension.

/Users/xiay/.rbenv/versions/2.2.5/bin/ruby -r ./siteconf20161108-8711-28jg0h.rb extconf.rb

creating Makefile

make "DESTDIR=" clean

make "DESTDIR=" compiling informixc.c informixc.ec:545:77: warning: format specifies type 'unsigned int' but the argument has type 'long' [-Wformat] rb_raise(rb_eOperationalError, "Could not set crate-time flags to 0x%X", FIX2LONG(createflags)); ~~ ^~~~~ %lX /Users/xiay/.rbenv/versions/2.2.5/include/ruby-2.2.0/ruby/ruby.h:355:21: note: expanded from macro 'FIX2LONG'

define FIX2LONG(x) ((long)RSHIFT((SIGNED_VALUE)(x),1))

                ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

informixc.ec:2018:2: error: assignment to cast is illegal, lvalue casts are not supported OBJ_FREEZE(server_type = rb_str_new2(c_version.server_type)); ^~~~~~~~~~~~~~~~ /Users/xiay/.rbenv/versions/2.2.5/include/ruby-2.2.0/ruby/ruby.h:1164:44: note: expanded from macro 'OBJ_FREEZE'

define OBJ_FREEZE(x) rb_obj_freeze_inline((VALUE)x)

                                       ^~~~~~~~

informixc.ec:2019:2: error: assignment to cast is illegal, lvalue casts are not supported OBJ_FREEZE(major = rb_str_new2(c_version.major)); ^~~~~~~~~~~~ /Users/xiay/.rbenv/versions/2.2.5/include/ruby-2.2.0/ruby/ruby.h:1164:44: note: expanded from macro 'OBJ_FREEZE'

define OBJ_FREEZE(x) rb_obj_freeze_inline((VALUE)x)

                                       ^~~~~~~~

informixc.ec:2020:2: error: assignment to cast is illegal, lvalue casts are not supported OBJ_FREEZE(minor = rb_str_new2(c_version.minor)); ^~~~~~~~~~~~ /Users/xiay/.rbenv/versions/2.2.5/include/ruby-2.2.0/ruby/ruby.h:1164:44: note: expanded from macro 'OBJ_FREEZE'

define OBJ_FREEZE(x) rb_obj_freeze_inline((VALUE)x)

                                       ^~~~~~~~

informixc.ec:2021:2: error: assignment to cast is illegal, lvalue casts are not supported OBJ_FREEZE(os = rb_str_new2(c_version.os)); ^~~~~~~~~~ /Users/xiay/.rbenv/versions/2.2.5/include/ruby-2.2.0/ruby/ruby.h:1164:44: note: expanded from macro 'OBJ_FREEZE'

define OBJ_FREEZE(x) rb_obj_freeze_inline((VALUE)x)

                                       ^~~~~~~~

informixc.ec:2022:2: error: assignment to cast is illegal, lvalue casts are not supported OBJ_FREEZE(level = rb_str_new2(c_version.level)); ^~~~~~~~~~~~ /Users/xiay/.rbenv/versions/2.2.5/include/ruby-2.2.0/ruby/ruby.h:1164:44: note: expanded from macro 'OBJ_FREEZE'

define OBJ_FREEZE(x) rb_obj_freeze_inline((VALUE)x)

                                       ^~~~~~~~

informixc.ec:2023:2: error: assignment to cast is illegal, lvalue casts are not supported OBJ_FREEZE(full = rb_str_new2(c_version.full)); ^~~~~~~~~~ /Users/xiay/.rbenv/versions/2.2.5/include/ruby-2.2.0/ruby/ruby.h:1164:44: note: expanded from macro 'OBJ_FREEZE'

define OBJ_FREEZE(x) rb_obj_freeze_inline((VALUE)x)

                                       ^~~~~~~~

1 warning and 6 errors generated. make: *\ [informixc.o] Error 1

make failed, exit code 2

NickTseng commented 7 years ago

i have same problem , please fix

santana commented 7 years ago

I have fixed it but not yet uploaded the gem.

Please try cloning the repository and building the gem like this:

gem build ruby-informix.gemspec

NickTseng commented 7 years ago

How to upgrade to Rails 5

smosab commented 7 years ago

@santana I cloned the repository and ran the command to build the gem but got this error:

C:\Users\msasi\ruby-informix-clone\ruby-informix>gem build ruby-informix.gemspec WARNING: See http://guides.rubygems.org/specification-reference/ for help ERROR: While executing gem ... (Gem::InvalidSpecificationException) ["ext/informixc.c"] are not files

santana commented 7 years ago

@smosab Try running esql first, like this:

cd ext && esql -e informix.ec

santana commented 7 years ago

@smosab I have updated Rakefile so you can just type:

rake gem
smosab commented 7 years ago

Thank you!

On Tue, Apr 25, 2017 at 9:07 PM, Gerardo Santana notifications@github.com wrote:

Closed #2 https://github.com/santana/ruby-informix/issues/2.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/santana/ruby-informix/issues/2#event-1057774083, or mute the thread https://github.com/notifications/unsubscribe-auth/ADmPNOI-3WYm2ITbx7iIsW1QjKxapBu4ks5rzrTlgaJpZM4IJbM4 .