I read Error Installing Atomic.
But my problem is different:
/Users/pills/.rvm/rubies/ruby-1.9.3-p448/bin/ruby extconf.rb
*** 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.
Provided configuration options:
--with-opt-dir
--with-opt-include
--without-opt-include=${opt-dir}/include
--with-opt-lib
--without-opt-lib=${opt-dir}/lib
--with-make-prog
--without-make-prog
--srcdir=.
--curdir
--ruby=/Users/pills/.rvm/rubies/ruby-1.9.3-p448/bin/ruby
--with-atomic_reference-dir
--without-atomic_reference-dir
--with-atomic_reference-include
--without-atomic_reference-include=${atomic_reference-dir}/include
--with-atomic_reference-lib
--without-atomic_reference-lib=${atomic_reference-dir}/lib
/Users/pills/.rvm/rubies/ruby-1.9.3-p448/lib/ruby/1.9.1/mkmf.rb:381:in `try_do': The compiler failed to generate an executable file. (RuntimeError)
You have to install development tools first.
from /Users/pills/.rvm/rubies/ruby-1.9.3-p448/lib/ruby/1.9.1/mkmf.rb:461:in `try_link0'
from /Users/pills/.rvm/rubies/ruby-1.9.3-p448/lib/ruby/1.9.1/mkmf.rb:712:in `try_run'
from extconf.rb:26:in `<main>'
From atomic web page I read that atomic requires JDK8, I installed it, I am in OS X 10.9.
Some other useful information:
$ /usr/libexec/java_home
/Library/Java/JavaVirtualMachines/jdk1.8.0.jdk/Contents/Home
$ /Library/Java/JavaVirtualMachines/jdk1.8.0.jdk/Contents/Home/bin/java -version
java version "1.8.0-ea"
Java(TM) SE Runtime Environment (build 1.8.0-ea-b114)
Java HotSpot(TM) 64-Bit Server VM (build 25.0-b56, mixed mode)
How should I reference JDK8 when installing this gem? is that the issue?
More useful output?
cat /Users/pills/.rvm/gems/ruby-1.9.3-p448/gems/atomic-1.1.14/ext/mkmf.log
"/usr/local/bin/gcc-4.2 -o conftest -I/Users/pills/.rvm/rubies/ruby-1.9.3-p448/include/ruby-1.9.1/x86_64-darwin12.4.0 -I/Users/pills/.rvm/rubies/ruby-1.9.3-p448/include/ruby-1.9.1/ruby/backward -I/Users/pills/.rvm/rubies/ruby-1.9.3-p448/include/ruby-1.9.1 -I. -D_XOPEN_SOURCE -D_DARWIN_C_SOURCE -I/usr/local/opt/libyaml/include -I/usr/local/opt/readline/include -I/usr/local/opt/libksba/include -I/usr/local/opt/openssl/include -O3 -ggdb -Wall -Wextra -Wno-unused-parameter -Wno-parentheses -Wno-long-long -Wno-missing-field-initializers -Wpointer-arith -Wwrite-strings -Wdeclaration-after-statement -Wshorten-64-to-32 -Wimplicit-function-declaration -fno-common -pipe conftest.c -L. -L/Users/pills/.rvm/rubies/ruby-1.9.3-p448/lib -L/usr/local/opt/libyaml/lib -L/usr/local/opt/readline/lib -L/usr/local/opt/libksba/lib -L/usr/local/opt/openssl/lib -L. -L/usr/local/opt/libyaml/lib -L/usr/local/opt/readline/lib -L/usr/local/opt/libksba/lib -L/usr/local/opt/openssl/lib -lruby.1.9.1 -lpthread -ldl -lobjc "
In file included from /Users/pills/.rvm/rubies/ruby-1.9.3-p448/include/ruby-1.9.1/ruby.h:32,
from conftest.c:1:
/Users/pills/.rvm/rubies/ruby-1.9.3-p448/include/ruby-1.9.1/ruby/ruby.h:48:21: error: string.h: No such file or directory
/Users/pills/.rvm/rubies/ruby-1.9.3-p448/include/ruby-1.9.1/ruby/ruby.h:58:21: error: stdint.h: No such file or directory
/Users/pills/.rvm/rubies/ruby-1.9.3-p448/include/ruby-1.9.1/ruby/ruby.h:61:23: error: inttypes.h: No such file or directory
/Users/pills/.rvm/rubies/ruby-1.9.3-p448/include/ruby-1.9.1/ruby/ruby.h:65:19: error: stdio.h: No such file or directory
In file included from /Users/pills/.rvm/rubies/ruby-1.9.3-p448/include/ruby-1.9.1/ruby/ruby.h:67,
from /Users/pills/.rvm/rubies/ruby-1.9.3-p448/include/ruby-1.9.1/ruby.h:32,
from conftest.c:1:
/Users/pills/.rvm/rubies/ruby-1.9.3-p448/include/ruby-1.9.1/ruby/defines.h:29:21: error: stdlib.h: No such file or directory
In file included from /Users/pills/.rvm/rubies/ruby-1.9.3-p448/include/ruby-1.9.1/ruby.h:32,
from conftest.c:1:
/Users/pills/.rvm/rubies/ruby-1.9.3-p448/include/ruby-1.9.1/ruby/ruby.h:74:20: error: alloca.h: No such file or directory
In file included from /Users/pills/.rvm/rubies/ruby-1.9.3-p448/include/ruby-1.9.1/ruby/ruby.h:178,
from /Users/pills/.rvm/rubies/ruby-1.9.3-p448/include/ruby-1.9.1/ruby.h:32,
from conftest.c:1:
/usr/local/Cellar/apple-gcc42/4.2.1-5666.3/bin/../lib/gcc/i686-apple-darwin11/4.2.1/include/limits.h:10:25: error: limits.h: No such file or directory
In file included from /Users/pills/.rvm/rubies/ruby-1.9.3-p448/include/ruby-1.9.1/ruby/ruby.h:1383,
from /Users/pills/.rvm/rubies/ruby-1.9.3-p448/include/ruby-1.9.1/ruby.h:32,
from conftest.c:1:
/Users/pills/.rvm/rubies/ruby-1.9.3-p448/include/ruby-1.9.1/ruby/intern.h:36:23: error: sys/types.h: No such file or directory
/Users/pills/.rvm/rubies/ruby-1.9.3-p448/include/ruby-1.9.1/ruby/intern.h:40:22: error: sys/time.h: No such file or directory
In file included from /Users/pills/.rvm/rubies/ruby-1.9.3-p448/include/ruby-1.9.1/ruby/intern.h:43,
from /Users/pills/.rvm/rubies/ruby-1.9.3-p448/include/ruby-1.9.1/ruby/ruby.h:1383,
from /Users/pills/.rvm/rubies/ruby-1.9.3-p448/include/ruby-1.9.1/ruby.h:32,
from conftest.c:1:
/Users/pills/.rvm/rubies/ruby-1.9.3-p448/include/ruby-1.9.1/ruby/st.h:130: error: expected declaration specifiers or '...' before 'uint32_t'
In file included from /Users/pills/.rvm/rubies/ruby-1.9.3-p448/include/ruby-1.9.1/ruby/ruby.h:1383,
from /Users/pills/.rvm/rubies/ruby-1.9.3-p448/include/ruby-1.9.1/ruby.h:32,
from conftest.c:1:
/Users/pills/.rvm/rubies/ruby-1.9.3-p448/include/ruby-1.9.1/ruby/intern.h:294: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'rb_fdset_t'
/Users/pills/.rvm/rubies/ruby-1.9.3-p448/include/ruby-1.9.1/ruby/intern.h:389: error: expected declaration specifiers or '...' before 'fd_set'
/Users/pills/.rvm/rubies/ruby-1.9.3-p448/include/ruby-1.9.1/ruby/intern.h:389: error: expected declaration specifiers or '...' before 'fd_set'
/Users/pills/.rvm/rubies/ruby-1.9.3-p448/include/ruby-1.9.1/ruby/intern.h:389: error: expected declaration specifiers or '...' before 'fd_set'
/Users/pills/.rvm/rubies/ruby-1.9.3-p448/include/ruby-1.9.1/ruby/intern.h:389: warning: 'struct timeval' declared inside parameter list
/Users/pills/.rvm/rubies/ruby-1.9.3-p448/include/ruby-1.9.1/ruby/intern.h:389: warning: its scope is only this definition or declaration, which is probably not what you want
/Users/pills/.rvm/rubies/ruby-1.9.3-p448/include/ruby-1.9.1/ruby/intern.h:390: error: expected declaration specifiers or '...' before 'rb_fdset_t'
/Users/pills/.rvm/rubies/ruby-1.9.3-p448/include/ruby-1.9.1/ruby/intern.h:390: error: expected declaration specifiers or '...' before 'rb_fdset_t'
/Users/pills/.rvm/rubies/ruby-1.9.3-p448/include/ruby-1.9.1/ruby/intern.h:390: error: expected declaration specifiers or '...' before 'rb_fdset_t'
/Users/pills/.rvm/rubies/ruby-1.9.3-p448/include/ruby-1.9.1/ruby/intern.h:390: warning: 'struct timeval' declared inside parameter list
/Users/pills/.rvm/rubies/ruby-1.9.3-p448/include/ruby-1.9.1/ruby/intern.h:391: warning: 'struct timeval' declared inside parameter list
/Users/pills/.rvm/rubies/ruby-1.9.3-p448/include/ruby-1.9.1/ruby/intern.h:563: error: expected declaration specifiers or '...' before 'pid_t'
/Users/pills/.rvm/rubies/ruby-1.9.3-p448/include/ruby-1.9.1/ruby/intern.h:581: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'rb_fork'
/Users/pills/.rvm/rubies/ruby-1.9.3-p448/include/ruby-1.9.1/ruby/intern.h:582: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'rb_fork_err'
/Users/pills/.rvm/rubies/ruby-1.9.3-p448/include/ruby-1.9.1/ruby/intern.h:584: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'rb_waitpid'
/Users/pills/.rvm/rubies/ruby-1.9.3-p448/include/ruby-1.9.1/ruby/intern.h:585: error: expected ')' before 'pid'
/Users/pills/.rvm/rubies/ruby-1.9.3-p448/include/ruby-1.9.1/ruby/intern.h:586: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'rb_spawn'
/Users/pills/.rvm/rubies/ruby-1.9.3-p448/include/ruby-1.9.1/ruby/intern.h:587: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'rb_spawn_err'
/Users/pills/.rvm/rubies/ruby-1.9.3-p448/include/ruby-1.9.1/ruby/intern.h:589: error: expected ')' before 'pid'
/Users/pills/.rvm/rubies/ruby-1.9.3-p448/include/ruby-1.9.1/ruby/intern.h:708: error: expected declaration specifiers or '...' before 'uint32_t'
/Users/pills/.rvm/rubies/ruby-1.9.3-p448/include/ruby-1.9.1/ruby/intern.h:833: error: expected ')' before 'long'
/Users/pills/.rvm/rubies/ruby-1.9.3-p448/include/ruby-1.9.1/ruby/intern.h:834: error: expected ')' before 'long'
checked program was:
/* begin */
1: #include "ruby.h"
2:
3: int main(int argc, char **argv)
4: {
5: return 0;
6: }
/* end */
I did not require JDK8, I did:
xcode-select --install
gem install atomic -v '1.1.14
And it worked.
Related
I am getting the following error:
gem install ibm_db
Temporarily enhancing PATH to include DevKit...
Building native extensions. This could take a while...
ERROR: Error installing ibm_db:
ERROR: Failed to build gem native extension.
current directory: C:/Ruby21-x64/lib/ruby/gems/2.1.0/gems/ibm_db-3.0.4/ext
C:/Ruby21-x64/bin/ruby.exe -r ./siteconf20171018-4480-1i7vx9n.rb extconf.rb
Detected 64-bit Ruby
Detected usage of IBM Data Server Driver package. Ensure you have downloaded 64-bit package of IBM_Data_Server_Driver and retry the 'gem install ibm_db' command
creating gil_release_version
creating unicode_support_version
checking for SQLConnect() in -ldb2cli... yes
checking for gil_release_version... yes
checking for unicode_support_version... yes
creating Makefile
current directory: C:/Ruby21-x64/lib/ruby/gems/2.1.0/gems/ibm_db-3.0.4/ext
make "DESTDIR=" clean
current directory: C:/Ruby21-x64/lib/ruby/gems/2.1.0/gems/ibm_db-3.0.4/ext
make "DESTDIR="
generating ibm_db-x64-mingw32.def
compiling ibm_db.c
In file included from C:\Program Files\IBM\SQLLIB/include/sqlcli.h:983:0,
from C:\Program Files\IBM\SQLLIB/include/sqlcli1.h:45,
from ruby_ibm_db_cli.h:52,
from ibm_db.c:27:
C:\Program Files\IBM\SQLLIB/include/sqlext.h:1748:5: error: unknown type name '__in_ecount'
C:\Program Files\IBM\SQLLIB/include/sqlext.h:1751:5: error: unknown type name '__out_ecount_opt'
C:\Program Files\IBM\SQLLIB/include/sqlext.h:1754:5: error: unknown type name '__out_opt'
C:\Program Files\IBM\SQLLIB/include/sqlext.h:1865:5: error: unknown type name '__in_ecount'
C:\Program Files\IBM\SQLLIB/include/sqlext.h:1868:5: error: unknown type name '__out_ecount_opt'
C:\Program Files\IBM\SQLLIB/include/sqlext.h:1871:5: error: unknown type name '__out_opt'
C:\Program Files\IBM\SQLLIB/include/sqlext.h:1891:5: error: unknown type name '__in_ecount_opt'
C:\Program Files\IBM\SQLLIB/include/sqlext.h:1894:5: error: unknown type name '__in_ecount_opt'
C:\Program Files\IBM\SQLLIB/include/sqlext.h:1897:5: error: unknown type name '__in_ecount_opt'
C:\Program Files\IBM\SQLLIB/include/sqlext.h:1900:5: error: unknown type name '__in_ecount_opt'
C:\Program Files\IBM\SQLLIB/include/sqlext.h:1907:5: error: unknown type name '__out_opt'
C:\Program Files\IBM\SQLLIB/include/sqlext.h:1909:5: error: unknown type name '__out_opt'
C:\Program Files\IBM\SQLLIB/include/sqlext.h:1911:5: error: unknown type name '__out_opt'
C:\Program Files\IBM\SQLLIB/include/sqlext.h:1913:5: error: unknown type name '__out_opt'
C:\Program Files\IBM\SQLLIB/include/sqlext.h:1920:5: error: unknown type name '__out_opt'
C:\Program Files\IBM\SQLLIB/include/sqlext.h:1922:5: error: unknown type name '__out_opt'
C:\Program Files\IBM\SQLLIB/include/sqlext.h:1927:5: error: unknown type name '__in_ecount_opt'
C:\Program Files\IBM\SQLLIB/include/sqlext.h:1930:5: error: unknown type name '__in_ecount_opt'
C:\Program Files\IBM\SQLLIB/include/sqlext.h:1933:5: error: unknown type name '__in_ecount_opt'
C:\Program Files\IBM\SQLLIB/include/sqlext.h:1936:5: error: unknown type name '__in_ecount_opt'
C:\Program Files\IBM\SQLLIB/include/sqlext.h:1939:5: error: unknown type name '__in_ecount_opt'
C:\Program Files\IBM\SQLLIB/include/sqlext.h:1942:5: error: unknown type name '__in_ecount_opt'
C:\Program Files\IBM\SQLLIB/include/sqlext.h:1952:5: error: unknown type name '__in_ecount'
C:\Program Files\IBM\SQLLIB/include/sqlext.h:1954:5: error: unknown type name '__out_ecount_opt'
C:\Program Files\IBM\SQLLIB/include/sqlext.h:1961:5: error: unknown type name '__out_opt'
C:\Program Files\IBM\SQLLIB/include/sqlext.h:1971:5: error: unknown type name '__in_ecount_opt'
C:\Program Files\IBM\SQLLIB/include/sqlext.h:1974:5: error: unknown type name '__in_ecount_opt'
C:\Program Files\IBM\SQLLIB/include/sqlext.h:1977:5: error: unknown type name '__in_ecount_opt'
C:\Program Files\IBM\SQLLIB/include/sqlext.h:1983:5: error: unknown type name '__in_ecount_opt'
C:\Program Files\IBM\SQLLIB/include/sqlext.h:1986:5: error: unknown type name '__in_ecount_opt'
C:\Program Files\IBM\SQLLIB/include/sqlext.h:1989:5: error: unknown type name '__in_ecount_opt'
C:\Program Files\IBM\SQLLIB/include/sqlext.h:1992:5: error: unknown type name '__in_ecount_opt'
C:\Program Files\IBM\SQLLIB/include/sqlext.h:1998:5: error: unknown type name '__in_ecount_opt'
C:\Program Files\IBM\SQLLIB/include/sqlext.h:2001:5: error: unknown type name '__in_ecount_opt'
C:\Program Files\IBM\SQLLIB/include/sqlext.h:2004:5: error: unknown type name '__in_ecount_opt'
C:\Program Files\IBM\SQLLIB/include/sqlext.h:2018:5: error: unknown type name '__in_ecount_opt'
C:\Program Files\IBM\SQLLIB/include/sqlext.h:2021:5: error: unknown type name '__in_ecount_opt'
C:\Program Files\IBM\SQLLIB/include/sqlext.h:2024:5: error: unknown type name '__in_ecount_opt'
C:\Program Files\IBM\SQLLIB/include/sqlext.h:2031:5: error: unknown type name '__out_ecount_opt'
C:\Program Files\IBM\SQLLIB/include/sqlext.h:2034:5: error: unknown type name '__out_opt'
C:\Program Files\IBM\SQLLIB/include/sqlext.h:2036:5: error: unknown type name '__out_ecount_opt'
C:\Program Files\IBM\SQLLIB/include/sqlext.h:2039:5: error: unknown type name '__out_opt'
C:\Program Files\IBM\SQLLIB/include/sqlext.h:2087:5: error: unknown type name '__out'
C:\Program Files\IBM\SQLLIB/include/sqlext.h:2128:5: error: unknown type name '__in_opt'
C:\Program Files\IBM\SQLLIB/include/sqlext.h:2129:5: error: unknown type name '__out_bcount_opt'
C:\Program Files\IBM\SQLLIB/include/sqlext.h:2130:5: error: unknown type name '__in'
ibm_db.c:104:0: warning: "STRCASECMP" redefined [enabled by default]
In file included from c:/Ruby21-x64/include/ruby-2.1.0/ruby.h:33:0,
from ibm_db.c:21:
c:/Ruby21-x64/include/ruby-2.1.0/ruby/ruby.h:1783:0: note: this is the location of the previous definition
ibm_db.c: In function '_ruby_ibm_db_free_conn_struct':
ibm_db.c:490:7: warning: variable 'rc' set but not used [-Wunused-but-set-variable]
ibm_db.c: In function 'ibm_Ruby_Thread_Call':
ibm_db.c:696:5: warning: implicit declaration of function 'rb_thread_call_without_gvl' [-Wimplicit-function-declaration]
ibm_db.c: In function '_ruby_ibm_db_free_stmt_handle_and_resources':
ibm_db.c:718:7: warning: variable 'rc' set but not used [-Wunused-but-set-variable]
ibm_db.c: In function '_ruby_ibm_db_assign_options':
ibm_db.c:1430:35: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
ibm_db.c:1513:35: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
ibm_db.c: In function '_ruby_ibm_db_connect_helper2':
ibm_db.c:2181:34: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
ibm_db.c:2360:41: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
ibm_db.c: In function '_ruby_ibm_db_connect_helper':
ibm_db.c:2538:26: warning: comparison between pointer and integer [enabled by default]
ibm_db.c: In function 'ibm_db_createDBNX':
ibm_db.c:3255:9: warning: unused variable 'return_value' [-Wunused-variable]
ibm_db.c: In function 'ibm_db_autocommit':
ibm_db.c:3328:37: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
ibm_db.c: In function '_ruby_ibm_db_bind_parameter_helper':
ibm_db.c:6232:30: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
ibm_db.c:6256:53: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
ibm_db.c: In function 'ibm_db_execute':
ibm_db.c:7108:73: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
ibm_db.c: In function 'ibm_db_field_type':
ibm_db.c:8415:30: warning: initialization discards 'const' qualifier from pointer target type [enabled by default]
ibm_db.c:8438:15: warning: assignment discards 'const' qualifier from pointer target type [enabled by default]
ibm_db.c:8446:15: warning: assignment discards 'const' qualifier from pointer target type [enabled by default]
ibm_db.c:8449:15: warning: assignment discards 'const' qualifier from pointer target type [enabled by default]
ibm_db.c:8452:15: warning: assignment discards 'const' qualifier from pointer target type [enabled by default]
ibm_db.c:8455:15: warning: assignment discards 'const' qualifier from pointer target type [enabled by default]
ibm_db.c:8458:15: warning: assignment discards 'const' qualifier from pointer target type [enabled by default]
ibm_db.c:8461:15: warning: assignment discards 'const' qualifier from pointer target type [enabled by default]
ibm_db.c:8464:15: warning: assignment discards 'const' qualifier from pointer target type [enabled by default]
ibm_db.c:8467:15: warning: assignment discards 'const' qualifier from pointer target type [enabled by default]
ibm_db.c: In function 'ibm_db_result_cols':
ibm_db.c:10126:9: warning: unused variable 'ret_val' [-Wunused-variable]
ibm_db.c: In function 'ibm_db_server_info':
ibm_db.c:11252:17: warning: the comparison will always evaluate as 'false' for the address of 'connection' will never be NULL [-Waddress]
ibm_db.c: At top level:
ibm_db.c:48:13: warning: '_ruby_ibm_db_set_decfloat_rounding_mode_client' declared 'static' but never defined [-Wunused-function]
ibm_db.c:49:14: warning: '_ruby_ibm_db_instance_name' defined but not used [-Wunused-variable]
ibm_db.c:2592:12: warning: '_ruby_ibm_db_set_decfloat_rounding_mode_client_helper' defined but not used [-Wunused-function]
ibm_db.c: In function '_ruby_ibm_db_connect_helper2':
ibm_db.c:2433:1: warning: control reaches end of non-void function [-Wreturn-type]
ibm_db.c: In function 'ibm_Ruby_Thread_Call':
ibm_db.c:710:3: warning: control reaches end of non-void function [-Wreturn-type]
make: *** [ibm_db.o] Error 1
make failed, exit code 2
Gem files will remain installed in C:/Ruby21-x64/lib/ruby/gems/2.1.0/gems/ibm_db-3.0.4 for inspection.
Results logged to C:/Ruby21-x64/lib/ruby/gems/2.1.0/extensions/x64-mingw32/2.1.0/ibm_db-3.0.4/gem_make.out
I am trying to develop in local Ruby on Rails to a remote DB2 database, I have set global variables pointing to my DB2 cli and db2dsdriver.cfg config file with connection settings.
I have tried also with IBM data server driver package and cli is not detected.
Any advice? How can I install the ibm_db gem and connect to DB2??
======LoG: ===========================================================
gil_release_version is:
/* begin */
1: #ifndef GIL_RELEASE_VERSION
2: #define GIL_RELEASE_VERSION
3: #endif
/* end */
unicode_support_version is:
/* begin */
1: #ifndef UNICODE_SUPPORT_VERSION
2: #define UNICODE_SUPPORT_VERSION
3: #endif
/* end */
have_library: checking for SQLConnect() in -ldb2cli... -------------------- yes
"x86_64-w64-mingw32-gcc -o conftest.exe -IC:/Ruby21-x64/include/ruby-2.1.0/x64-mingw32 -IC:/Ruby21-x64/include/ruby-2.1.0/ruby/backward -IC:/Ruby21-x64/include/ruby-2.1.0 -I. "-IC:\Program Files\IBM\SQLLIB/include" -DFD_SETSIZE=2048 -D_WIN32_WINNT=0x0501 -D__MINGW_USE_VC2005_COMPAT -D_FILE_OFFSET_BITS=64 -O3 -fno-omit-frame-pointer -fno-fast-math -g -Wall -Wextra -Wno-unused-parameter -Wno-parentheses -Wno-long-long -Wno-missing-field-initializers -Wunused-variable -Wpointer-arith -Wwrite-strings -Wdeclaration-after-statement -Wimplicit-function-declaration conftest.c -L. -LC:/Ruby21-x64/lib -L"C:\Program Files\IBM\SQLLIB/lib" -L. -lx64-msvcrt-ruby210 -lshell32 -lws2_32 -liphlpapi -limagehlp -lshlwapi "
checked program was:
/* begin */
1: #include "ruby.h"
2:
3: #include <winsock2.h>
4: #include <windows.h>
5: int main(int argc, char **argv)
6: {
7: return 0;
8: }
/* end */
"x86_64-w64-mingw32-gcc -o conftest.exe -IC:/Ruby21-x64/include/ruby-2.1.0/x64-mingw32 -IC:/Ruby21-x64/include/ruby-2.1.0/ruby/backward -IC:/Ruby21-x64/include/ruby-2.1.0 -I. "-IC:\Program Files\IBM\SQLLIB/include" -DFD_SETSIZE=2048 -D_WIN32_WINNT=0x0501 -D__MINGW_USE_VC2005_COMPAT -D_FILE_OFFSET_BITS=64 -O3 -fno-omit-frame-pointer -fno-fast-math -g -Wall -Wextra -Wno-unused-parameter -Wno-parentheses -Wno-long-long -Wno-missing-field-initializers -Wunused-variable -Wpointer-arith -Wwrite-strings -Wdeclaration-after-statement -Wimplicit-function-declaration conftest.c -L. -LC:/Ruby21-x64/lib -L"C:\Program Files\IBM\SQLLIB/lib" -L. -lx64-msvcrt-ruby210 -ldb2cli -lshell32 -lws2_32 -liphlpapi -limagehlp -lshlwapi "
conftest.c: In function 't':
conftest.c:16:57: error: 'SQLConnect' undeclared (first use in this function)
conftest.c:16:57: note: each undeclared identifier is reported only once for each function it appears in
conftest.c:16:32: warning: variable 'p' set but not used [-Wunused-but-set-variable]
checked program was:
/* begin */
1: #include "ruby.h"
2:
3: #include <winsock2.h>
4: #include <windows.h>
5:
6: /*top*/
7: extern int t(void);
8: int main(int argc, char **argv)
9: {
10: if (argc > 1000000) {
11: printf("%p", &t);
12: }
13:
14: return 0;
15: }
16: int t(void) { void ((*volatile p)()); p = (void ((*)()))SQLConnect; return 0; }
/* end */
"x86_64-w64-mingw32-gcc -o conftest.exe -IC:/Ruby21-x64/include/ruby-2.1.0/x64-mingw32 -IC:/Ruby21-x64/include/ruby-2.1.0/ruby/backward -IC:/Ruby21-x64/include/ruby-2.1.0 -I. "-IC:\Program Files\IBM\SQLLIB/include" -DFD_SETSIZE=2048 -D_WIN32_WINNT=0x0501 -D__MINGW_USE_VC2005_COMPAT -D_FILE_OFFSET_BITS=64 -O3 -fno-omit-frame-pointer -fno-fast-math -g -Wall -Wextra -Wno-unused-parameter -Wno-parentheses -Wno-long-long -Wno-missing-field-initializers -Wunused-variable -Wpointer-arith -Wwrite-strings -Wdeclaration-after-statement -Wimplicit-function-declaration conftest.c -L. -LC:/Ruby21-x64/lib -L"C:\Program Files\IBM\SQLLIB/lib" -L. -lx64-msvcrt-ruby210 -ldb2cli -lshell32 -lws2_32 -liphlpapi -limagehlp -lshlwapi "
conftest.c: In function 't':
conftest.c:16:1: warning: implicit declaration of function 'SQLConnect' [-Wimplicit-function-declaration]
checked program was:
/* begin */
1: #include "ruby.h"
2:
3: #include <winsock2.h>
4: #include <windows.h>
5:
6: /*top*/
7: extern int t(void);
8: int main(int argc, char **argv)
9: {
10: if (argc > 1000000) {
11: printf("%p", &t);
12: }
13:
14: return 0;
15: }
16: int t(void) { SQLConnect(); return 0; }
/* end */
--------------------
have_header: checking for gil_release_version... -------------------- yes
"x86_64-w64-mingw32-gcc -E -IC:/Ruby21-x64/include/ruby-2.1.0/x64-mingw32 -IC:/Ruby21-x64/include/ruby-2.1.0/ruby/backward -IC:/Ruby21-x64/include/ruby-2.1.0 -I. "-IC:\Program Files\IBM\SQLLIB/include" -DFD_SETSIZE=2048 -D_WIN32_WINNT=0x0501 -D__MINGW_USE_VC2005_COMPAT -D_FILE_OFFSET_BITS=64 -O3 -fno-omit-frame-pointer -fno-fast-math -g -Wall -Wextra -Wno-unused-parameter -Wno-parentheses -Wno-long-long -Wno-missing-field-initializers -Wunused-variable -Wpointer-arith -Wwrite-strings -Wdeclaration-after-statement -Wimplicit-function-declaration conftest.c -o conftest.i"
checked program was:
/* begin */
1: #include "ruby.h"
2:
3: #include <winsock2.h>
4: #include <windows.h>
5: #include <gil_release_version>
/* end */
--------------------
have_header: checking for unicode_support_version... -------------------- yes
"x86_64-w64-mingw32-gcc -E -IC:/Ruby21-x64/include/ruby-2.1.0/x64-mingw32 -IC:/Ruby21-x64/include/ruby-2.1.0/ruby/backward -IC:/Ruby21-x64/include/ruby-2.1.0 -I. "-IC:\Program Files\IBM\SQLLIB/include" -DFD_SETSIZE=2048 -D_WIN32_WINNT=0x0501 -D__MINGW_USE_VC2005_COMPAT -D_FILE_OFFSET_BITS=64 -O3 -fno-omit-frame-pointer -fno-fast-math -g -Wall -Wextra -Wno-unused-parameter -Wno-parentheses -Wno-long-long -Wno-missing-field-initializers -Wunused-variable -Wpointer-arith -Wwrite-strings -Wdeclaration-after-statement -Wimplicit-function-declaration conftest.c -o conftest.i"
checked program was:
/* begin */
1: #include "ruby.h"
2:
3: #include <winsock2.h>
4: #include <windows.h>
5: #include <unicode_support_version>
/* end */
--------------------
I am using...
Ruby 2.1.5
Devkit-mingw64-64-4.7.2-20130224-1432-sfx
Gem ibm_db 3.0.4 x86-mingw32
IBM data server client 10.5
Over Windows 10
RubyGems Environment:
- RUBYGEMS VERSION: 2.6.13
- RUBY VERSION: 2.1.5 (2014-11-13 patchlevel 273) [x64-mingw32]
- INSTALLATION DIRECTORY: C:/Ruby21-x64/lib/ruby/gems/2.1.0
- USER INSTALLATION DIRECTORY: C:/Users/mypc/.gem/ruby/2.1.0
- RUBY EXECUTABLE: C:/Ruby21-x64/bin/ruby.exe
- EXECUTABLE DIRECTORY: C:/Ruby21-x64/bin
- SPEC CACHE DIRECTORY: C:/Users/mypc/.gem/specs
- SYSTEM CONFIGURATION DIRECTORY: C:/ProgramData
- RUBYGEMS PLATFORMS:
- ruby
- x64-mingw32
- GEM PATHS:
- C:/Ruby21-x64/lib/ruby/gems/2.1.0
- C:/Users/mypc/.gem/ruby/2.1.0
- GEM CONFIGURATION:
- :update_sources => true
- :verbose => true
- :backtrace => false
- :bulk_threshold => 1000
- REMOTE SOURCES:
- https://rubygems.org/
- SHELL PATH:
- C:\Program Files (x86)\Intel\iCLS Client\
- C:\Program Files\Intel\iCLS Client\
- C:\Windows\system32
- C:\Windows
- C:\Windows\System32\Wbem
- C:\Windows\System32\WindowsPowerShell\v1.0\
- C:\Program Files (x86)\Intel\Intel(R) Management Engine Components\DAL
- C:\Program Files\Intel\Intel(R) Management Engine Components\DAL
- C:\Program Files (x86)\Intel\Intel(R) Management Engine Components\IPT
- C:\Program Files\Intel\Intel(R) Management Engine Components\IPT
- C:\PROGRA~1\IBM\SQLLIB\BIN
- C:\PROGRA~1\IBM\SQLLIB\FUNCTION
- C:\PROGRA~1\IBM\SQLLIB\SAMPLES\REPL
- C:\Ruby23-x64\bin
- C:\Ruby24-x64\bin
- C:\Ruby21-x64\bin
- C:\Users\mypc\AppData\Local\Microsoft\WindowsApps
friend.
I need instructions for compiling this utility. But I can not find info.
My current scenario is Win7, Lua 5.1 (because it is installed in my machine by my son, but later I'll try with Lua v5.3.## current).
I have seen on a txt file this command:
gcc string.c dbf_head.c dbf_ndx.c dbf_misc.c dbf_rec.c luadbase.c -shared -O2 -Wall -L/usr/local/lib -llua -ldl -lm -lnsl -o dbase.so
As I understand that /usr/local/lib is a Linux dir, then I change it for ./
I consider that this means that I will look for libraries in the directory I write: in my case I say it that the libraries is in the same dir. http://iie.fing.edu.uy/~vagonbar/gcc-make/gcc.htm
First try:
I create make_win.bat with this content (see the .DLL extension):
gcc string.c dbf_head.c dbf_ndx.c dbf_misc.c dbf_rec.c luadbase.c
-shared -O2 -Wall -L./ -llua -ldl -lm -lnsl -o dbase.dll
D:\lua-dbase-compiling>make_win
D:\lua-dbase-compiling>gcc string.c dbf_head.c dbf_ndx.c dbf_misc.c dbf_rec.c lu
adbase.c -shared -O2 -Wall -L./ -llua -ldl -lm -lnsl -o dbase.dll
dbf_rec.c: In function 'pack_dbf':
dbf_rec.c:131: warning: implicit declaration of function 'ftruncate'
luadbase.c:20:17: error: lua.h: No such file or directory
luadbase.c:21:21: error: lauxlib.h: No such file or directory
luadbase.c:23:24: error: compat-5.1.h: No such file or directory
luadbase.c:48: error: expected ')' before '*' token
luadbase.c:49: error: expected ')' before '*' token
luadbase.c:50: error: expected ')' before '*' token
luadbase.c:56: error: expected ')' before '*' token
luadbase.c:67: error: expected ')' before '*' token
luadbase.c:77: error: expected ')' before '*' token
luadbase.c:85: error: expected ')' before '*' token
luadbase.c:113: error: expected ')' before '*' token
luadbase.c:120: error: expected ')' before '*' token
luadbase.c:141: error: expected ')' before '*' token
luadbase.c:146: error: expected ')' before '*' token
luadbase.c:151: error: expected ')' before '*' token
luadbase.c:160: error: expected ')' before '*' token
luadbase.c:231: error: expected ')' before '*' token
luadbase.c:398: error: expected ')' before '*' token
luadbase.c:402: error: expected ')' before '*' token
luadbase.c:406: error: expected ')' before '*' token
luadbase.c:428: error: expected ')' before '*' token
luadbase.c:501: error: expected ')' before '*' token
luadbase.c:686: error: expected ')' before '*' token
luadbase.c:700: error: expected ')' before '*' token
luadbase.c:709: error: expected ')' before '*' token
As it it saying that cannot find three files: lua.h, lauxlib.h and compat-5.1.h, then I look for them in m PC. I find them, then copy'em to the dir where I have the sources for DBASE.DLL .
Second try:
I run make_win.bat with this same content as the first try.
I got a long list of error and warnings. The several first --as you can see in next lines-- indicates me that it could not find the three files I copy.
D:\lua-dbase-compiling>make_win
D:\lua-dbase-compiling>gcc string.c dbf_head.c dbf_ndx.c dbf_misc.c dbf_rec.c lu
adbase.c -shared -O2 -Wall -L./ -llua -ldl -lm -lnsl -o dbase.dll
dbf_rec.c: In function 'pack_dbf':
dbf_rec.c:131: warning: implicit declaration of function 'ftruncate'
In file included from luadbase.c:20:
lua.h:16:21: error: luaconf.h: No such file or directory
In file included from luadbase.c:20:
lua.h:99: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'lua_Nu
mber'
lua.h:103: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'lua_I
nteger'
lua.h:110: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'lua_S
tate'
lua.h:111: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'void'
In file included from luadbase.c:21:
lauxlib.h:42: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'vo
id'
lauxlib.h:44: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'vo
id'
lauxlib.h:46: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'in
t'
lauxlib.h:47: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'in
t'
luadbase.c: In function 'luaM_tostring':
luadbase.c:58: warning: implicit declaration of function 'lua_touserdata'
luadbase.c:63: warning: implicit declaration of function 'lua_pushfstring'
luadbase.c:63: warning: implicit declaration of function 'lua_tolstring'
luadbase.c: In function 'luaM_regconst':
luadbase.c:68: warning: implicit declaration of function 'lua_pushstring'
luadbase.c:69: warning: implicit declaration of function 'lua_pushnumber'
luadbase.c:70: warning: implicit declaration of function 'lua_rawset'
luadbase.c: In function 'luaM_setmeta':
luadbase.c:78: warning: implicit declaration of function 'lua_getfield'
Then I decided to copy all the sources of Lua v.5.1.4 and the some more for compat-5.1 (that are not in the same sources).
Third try:
I run make_win.bat with this same content as the first and second try.
The error were a few, in just seven lines.
D:\lua-dbase-compiling>gcc string.c dbf_head.c dbf_ndx.c dbf_misc.c dbf_rec.c lu
adbase.c -shared -O2 -Wall -L./ -llua -ldl -lm -lnsl -o dbase.dll
dbf_rec.c: In function 'pack_dbf':
dbf_rec.c:131: warning: implicit declaration of function 'ftruncate'
ld: cannot find -llua
ld: cannot find -ldl
ld: cannot find -lnsl
As I am not an expert C programmer, I decided to supress this three arguments: -llua -ldl -lnsl in the runable sentence.
Forth try:
Now the sentence is:
gcc string.c dbf_head.c dbf_ndx.c dbf_misc.c dbf_rec.c luadbase.c -shared -O2 -Wall -L./ -lm -o dbase.dll
I got a lot of errors. I got no the first lines:
C:\Users\user\AppData\Local\Temp\ccwaAh3E.o:luadbase.c:(.text+0x1f8): undefined
reference to `lua_tolstring'
C:\Users\user\AppData\Local\Temp\ccwaAh3E.o:luadbase.c:(.text+0x210): undefined
reference to lua_tolstring'
C:\Users\user\AppData\Local\Temp\ccwaAh3E.o:luadbase.c:(.text+0x220): undefined
reference tolua_rawset'
C:\Users\user\AppData\Local\Temp\ccwaAh3E.o:luadbase.c:(.text+0x230): undefined
reference to lua_settop'
C:\Users\user\AppData\Local\Temp\ccwaAh3E.o:luadbase.c:(.text+0x240): undefined
reference tolua_next'
C:\Users\user\AppData\Local\Temp\ccwaAh3E.o:luadbase.c:(.text+0x254): undefined
reference to lua_settop'
C:\Users\user\AppData\Local\Temp\ccwaAh3E.o:luadbase.c:(.text+0x264): undefined
reference tolua_objlen'
C:\Users\user\AppData\Local\Temp\ccwaAh3E.o:luadbase.c:(.text+0x27e): undefined
reference to lua_pushboolean'
C:\Users\user\AppData\Local\Temp\ccwaAh3E.o:luadbase.c:(.text+0x28e): undefined
reference tolua_pushstring'
C:\Users\user\AppData\Local\Temp\ccwaAh3E.o:luadbase.c:(.text+0x2ac): undefined
reference to lua_tonumber'
C:\Users\user\AppData\Local\Temp\ccwaAh3E.o:luadbase.c:(.text+0x2bf): undefined
reference tolua_settop'
C:\Users\user\AppData\Local\Temp\ccwaAh3E.o:luadbase.c:(.text+0x31b): undefined
reference to `lua_rawgeti'
C:\Users\user\AppData\Local\Temp\ccwaAh3E.o:luadbase.c:(.text+0x336): undefined
I do not understand.
I do not see any DLL in the directory.
I do not know how to proceed.
Any help would be appreciated.
Thanks for reading this question.
HERNAN CANO M.
I am running Kali,
Trying to install ruby1.9.3 after having successfully installed SNORT, PULLEDPORK an BARNYARD2
%%%%%% EXECUTING THESE COMMANDS
1) %%% wget https://cache.ruby-lang.org/pub/ruby/1.9/ruby-1.9.3-p551.tar.gz
2) %%% tar -xvzf ruby-1.9.3-p551.tar.gz
3) %%% cd ruby-1.9.3-p551
4) %%% ./configure
5) %%% make
6) %%% make install
1st 3 commands run OK,
getting ERRORS n Warnings on (5) make command.
Output like this:-
root#kali:~/snort_src/ruby-1.9.3-p551# make
CC = gcc
LD = ld
LDSHARED = gcc -shared
CFLAGS = -O3 -ggdb -Wall -Wextra -Wno-unused-parameter -Wno-parentheses -Wno-long-long -Wno-missing-field-initializers -Wpointer-arith -Wwrite-strings -Wdeclaration-after-statement -Wimplicit-function-declaration
XCFLAGS = -include ruby/config.h -include ruby/missing.h -fvisibility=hidden -DRUBY_EXPORT
CPPFLAGS = -I. -I.ext/include/x86_64-linux -I./include -I.
DLDFLAGS =
SOLIBS =
linking miniruby
rbconfig.rb unchanged
generating enc.mk
generating prelude.c
compiling prelude.c
linking static-library libruby-static.a
ar: `u' modifier ignored since `D' is the default (see `U')
generating encdb.h
encdb.h unchanged
making enc
make[1]: Entering directory '/root/snort_src/ruby-1.9.3-p551'
make[1]: Nothing to be done for 'enc'.
.
.
.
compiling ossl_ssl.c
ossl_ssl.c:116:27: error: ‘SSLv3_method’ undeclared here (not in a function)
OSSL_SSL_METHOD_ENTRY(SSLv3),
^
ossl_ssl.c:106:69: note: in definition of macro ‘OSSL_SSL_METHOD_ENTRY’
#define OSSL_SSL_METHOD_ENTRY(name) { #name, (SSL_METHOD *(*)(void))name##_method }
^
ossl_ssl.c:117:27: error: ‘SSLv3_server_method’ undeclared here (not in a function)
OSSL_SSL_METHOD_ENTRY(SSLv3_server),
^
ossl_ssl.c:106:69: note: in definition of macro ‘OSSL_SSL_METHOD_ENTRY’
#define OSSL_SSL_METHOD_ENTRY(name) { #name, (SSL_METHOD *(*)(void))name##_method }
^
ossl_ssl.c:118:27: error: ‘SSLv3_client_method’ undeclared here (not in a function)
OSSL_SSL_METHOD_ENTRY(SSLv3_client),
^
ossl_ssl.c:106:69: note: in definition of macro ‘OSSL_SSL_METHOD_ENTRY’
#define OSSL_SSL_METHOD_ENTRY(name) { #name, (SSL_METHOD *(*)(void))name##_method }
^
ossl_ssl.c: In function ‘ossl_sslctx_session_new_cb’:
ossl_ssl.c:382:35: warning: variable ‘ret_obj’ set but not used [-Wunused-but-set-variable]
VALUE ary, ssl_obj, sess_obj, ret_obj;
^
ossl_ssl.c: In function ‘ossl_sslctx_session_remove_cb’:
ossl_ssl.c:431:38: warning: variable ‘ret_obj’ set but not used [-Wunused-but-set-variable]
VALUE ary, sslctx_obj, sess_obj, ret_obj;
^
ossl_ssl.c: In function ‘ssl_servername_cb’:
ossl_ssl.c:508:25: warning: variable ‘ret_obj’ set but not used [-Wunused-but-set-variable]
VALUE ary, ssl_obj, ret_obj;
^
Makefile:269: recipe for target 'ossl_ssl.o' failed
make[2]: *** [ossl_ssl.o] Error 1
make[2]: Leaving directory '/root/snort_src/ruby-1.9.3-p551/ext/openssl'
exts.mk:126: recipe for target 'ext/openssl/all' failed
make[1]: *** [ext/openssl/all] Error 2
make[1]: Leaving directory '/root/snort_src/ruby-1.9.3-p551'
uncommon.mk:178: recipe for target 'build-ext' failed
make: *** [build-ext] Error 2
Kindly suggest a way out.
I am having trouble installing crypt-ruby 3.0.1 on my mac. Does anyone now what the cause of this maybe? Below is the following output error.
Dorians-MacBook-Pro:rentsnap_webapp dorianflowers$ gem install bcrypt-ruby -v '3.0.1'
Building native extensions. This could take a while...
ERROR: Error installing bcrypt-ruby:
ERROR: Failed to build gem native extension.
/Users/dorianflowers/.rvm/rubies/ruby-2.1.0/bin/ruby -r ./siteconf20150722-8311-1gpgksu.rb extconf.rb
creating Makefile
make "DESTDIR=" clean
make "DESTDIR="
compiling bcrypt_ext.c
In file included from /Users/dorianflowers/.rvm/rubies/ruby-2.1.0/include/ruby-2.1.0/ruby/ruby.h:29,
from /Users/dorianflowers/.rvm/rubies/ruby-2.1.0/include/ruby-2.1.0/ruby.h:33,
from bcrypt_ext.c:1:
/Users/dorianflowers/.rvm/rubies/ruby-2.1.0/include/ruby-2.1.0/ruby/defines.h:26:19: error: stdio.h: No such file or directory
/Users/dorianflowers/.rvm/rubies/ruby-2.1.0/include/ruby-2.1.0/ruby/defines.h:28:24: error: sys/types.h: No such file or directory
/Users/dorianflowers/.rvm/rubies/ruby-2.1.0/include/ruby-2.1.0/ruby/defines.h:31:23: error: sys/stat.h: No such file or directory
/Users/dorianflowers/.rvm/rubies/ruby-2.1.0/include/ruby-2.1.0/ruby/defines.h:34:21: error: stdlib.h: No such file or directory
/Users/dorianflowers/.rvm/rubies/ruby-2.1.0/include/ruby-2.1.0/ruby/defines.h:45:21: error: string.h: No such file or directory
/Users/dorianflowers/.rvm/rubies/ruby-2.1.0/include/ruby-2.1.0/ruby/defines.h:48:22: error: strings.h: No such file or directory
/Users/dorianflowers/.rvm/rubies/ruby-2.1.0/include/ruby-2.1.0/ruby/defines.h:51:23: error: inttypes.h: No such file or directory
/Users/dorianflowers/.rvm/rubies/ruby-2.1.0/include/ruby-2.1.0/ruby/defines.h:54:21: error: stdint.h: No such file or directory
/Users/dorianflowers/.rvm/rubies/ruby-2.1.0/include/ruby-2.1.0/ruby/defines.h:57:21: error: unistd.h: No such file or directory
/Users/dorianflowers/.rvm/rubies/ruby-2.1.0/include/ruby-2.1.0/ruby/defines.h:61:25: error: sys/select.h: No such file or directory
In file included from /Users/dorianflowers/.rvm/rubies/ruby-2.1.0/include/ruby-2.1.0/ruby/defines.h:68,
from /Users/dorianflowers/.rvm/rubies/ruby-2.1.0/include/ruby-2.1.0/ruby/ruby.h:29,
from /Users/dorianflowers/.rvm/rubies/ruby-2.1.0/include/ruby-2.1.0/ruby.h:33,
from bcrypt_ext.c:1:
/Users/dorianflowers/.rvm/rubies/ruby-2.1.0/include/ruby-2.1.0/ruby/missing.h:23:45: error: math.h: No such file or directory
In file included from /Users/dorianflowers/.rvm/rubies/ruby-2.1.0/include/ruby-2.1.0/ruby/ruby.h:184,
from /Users/dorianflowers/.rvm/rubies/ruby-2.1.0/include/ruby-2.1.0/ruby.h:33,
from bcrypt_ext.c:1:
/Applications/Xcode.app/Contents/Developer/usr/llvm-gcc-4.2/lib/gcc/i686-apple-darwin11/4.2.1/include/limits.h:15:25: error: limits.h: No such file or directory
In file included from /Users/dorianflowers/.rvm/rubies/ruby-2.1.0/include/ruby-2.1.0/ruby/intern.h:35,
from /Users/dorianflowers/.rvm/rubies/ruby-2.1.0/include/ruby-2.1.0/ruby/ruby.h:1694,
from /Users/dorianflowers/.rvm/rubies/ruby-2.1.0/include/ruby-2.1.0/ruby.h:33,
from bcrypt_ext.c:1:
/Users/dorianflowers/.rvm/rubies/ruby-2.1.0/include/ruby-2.1.0/ruby/st.h:139: error: expected declaration specifiers or ‘...’ before ‘uint32_t’
In file included from /Users/dorianflowers/.rvm/rubies/ruby-2.1.0/include/ruby-2.1.0/ruby/ruby.h:1694,
from /Users/dorianflowers/.rvm/rubies/ruby-2.1.0/include/ruby-2.1.0/ruby.h:33,
from bcrypt_ext.c:1:
/Users/dorianflowers/.rvm/rubies/ruby-2.1.0/include/ruby-2.1.0/ruby/intern.h:348: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘rb_fdset_t’
/Users/dorianflowers/.rvm/rubies/ruby-2.1.0/include/ruby-2.1.0/ruby/intern.h:440: error: expected declaration specifiers or ‘...’ before ‘fd_set’
/Users/dorianflowers/.rvm/rubies/ruby-2.1.0/include/ruby-2.1.0/ruby/intern.h:440: error: expected declaration specifiers or ‘...’ before ‘fd_set’
/Users/dorianflowers/.rvm/rubies/ruby-2.1.0/include/ruby-2.1.0/ruby/intern.h:440: error: expected declaration specifiers or ‘...’ before ‘fd_set’
/Users/dorianflowers/.rvm/rubies/ruby-2.1.0/include/ruby-2.1.0/ruby/intern.h:440: warning: ‘struct timeval’ declared inside parameter list
/Users/dorianflowers/.rvm/rubies/ruby-2.1.0/include/ruby-2.1.0/ruby/intern.h:440: warning: its scope is only this definition or declaration, which is probably not what you want
/Users/dorianflowers/.rvm/rubies/ruby-2.1.0/include/ruby-2.1.0/ruby/intern.h:441: error: expected declaration specifiers or ‘...’ before ‘rb_fdset_t’
/Users/dorianflowers/.rvm/rubies/ruby-2.1.0/include/ruby-2.1.0/ruby/intern.h:441: error: expected declaration specifiers or ‘...’ before ‘rb_fdset_t’
/Users/dorianflowers/.rvm/rubies/ruby-2.1.0/include/ruby-2.1.0/ruby/intern.h:441: error: expected declaration specifiers or ‘...’ before ‘rb_fdset_t’
/Users/dorianflowers/.rvm/rubies/ruby-2.1.0/include/ruby-2.1.0/ruby/intern.h:441: warning: ‘struct timeval’ declared inside parameter list
/Users/dorianflowers/.rvm/rubies/ruby-2.1.0/include/ruby-2.1.0/ruby/intern.h:442: warning: ‘struct timeval’ declared inside parameter list
/Users/dorianflowers/.rvm/rubies/ruby-2.1.0/include/ruby-2.1.0/ruby/intern.h:545: error: expected declaration specifiers or ‘...’ before ‘mode_t’
/Users/dorianflowers/.rvm/rubies/ruby-2.1.0/include/ruby-2.1.0/ruby/intern.h:624: error: expected declaration specifiers or ‘...’ before ‘pid_t’
/Users/dorianflowers/.rvm/rubies/ruby-2.1.0/include/ruby-2.1.0/ruby/intern.h:638: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘rb_fork’
/Users/dorianflowers/.rvm/rubies/ruby-2.1.0/include/ruby-2.1.0/ruby/intern.h:639: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘rb_fork_err’
/Users/dorianflowers/.rvm/rubies/ruby-2.1.0/include/ruby-2.1.0/ruby/intern.h:641: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘rb_waitpid’
/Users/dorianflowers/.rvm/rubies/ruby-2.1.0/include/ruby-2.1.0/ruby/intern.h:642: error: expected ‘)’ before ‘pid’
/Users/dorianflowers/.rvm/rubies/ruby-2.1.0/include/ruby-2.1.0/ruby/intern.h:643: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘rb_spawn’
/Users/dorianflowers/.rvm/rubies/ruby-2.1.0/include/ruby-2.1.0/ruby/intern.h:644: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘rb_spawn_err’
/Users/dorianflowers/.rvm/rubies/ruby-2.1.0/include/ruby-2.1.0/ruby/intern.h:646: error: expected ‘)’ before ‘pid’
/Users/dorianflowers/.rvm/rubies/ruby-2.1.0/include/ruby-2.1.0/ruby/intern.h:755: error: expected declaration specifiers or ‘...’ before ‘uint32_t’
/Users/dorianflowers/.rvm/rubies/ruby-2.1.0/include/ruby-2.1.0/ruby/intern.h:882: error: expected ‘)’ before ‘long’
/Users/dorianflowers/.rvm/rubies/ruby-2.1.0/include/ruby-2.1.0/ruby/intern.h:883: error: expected ‘)’ before ‘long’
bcrypt_ext.c: In function ‘bc_salt’:
bcrypt_ext.c:46: warning: incompatible implicit declaration of built-in function ‘strlen’
make: *** [bcrypt_ext.o] Error 1
make failed, exit code 2
Gem files will remain installed in /Users/dorianflowers/.rvm/gems/ruby-2.1.0/gems/bcrypt-ruby-3.0.1 for inspection.
Results logged to /Users/dorianflowers/.rvm/gems/ruby-2.1.0/extensions/x86_64-darwin-14/2.1.0-static/bcrypt-ruby-3.0.1/gem_make.out
According to this article, it seems to be caused by an update to xcode tools on mac, to fix this you need to add a flag to ignore that error like it used to do before.
For example in my case this worked:
gem install bcrypt-ruby:3.0.1 -- --build-flags --with-cflags="-Wno-error=implicit-function-declaration"
These errors all indicate that there is no compiler on your computer:
error: stdio.h: No such file or directory
error: sys/types.h: No such file or directory
error: sys/stat.h: No such file or directory
error: stdlib.h: No such file or directory
error: string.h: No such file or directory
error: strings.h: No such file or directory
error: inttypes.h: No such file or directory
error: stdint.h: No such file or directory
error: unistd.h: No such file or directory
error: sys/select.h: No such file or directory
On macOS, the easiest way to resolve this is to install the Xcode command line tools:
xcode-select --install
The Xcode command line tools include all the above libraries and the compilers needed to build bcrypt-ruby. (and most other gems)
I am trying to configure a rails server to use PostgreSQL, but getting stuck when installing the postgres gem. I have installed PostgreSQL successfully on the machine (and can use it for other applications) but am getting an error when attempting to install the ruby gem for it.
I do: sudo gem install postgres
And get the following output:
Building native extensions. This could take a while...
ERROR: Error installing postgres:
ERROR: Failed to build gem native extension.
/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/bin/ruby extconf.rb
checking for main() in -lpq... yes
checking for libpq-fe.h... yes
checking for libpq/libpq-fs.h... yes
checking for PQsetClientEncoding()... no
checking for pg_encoding_to_char()... no
checking for PQfreemem()... no
checking for PQserverVersion()... no
checking for PQescapeString()... no
creating Makefile
make
gcc -I. -I. -I/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/universal-darwin10.0 -I. -DHAVE_LIBPQ_FE_H -DHAVE_LIBPQ_LIBPQ_FS_H -I/Library/PostgreSQL/8.4/include -D_XOPEN_SOURCE -D_DARWIN_C_SOURCE -fno-common -arch i386 -arch x86_64 -g -Os -pipe -fno-common -DENABLE_DTRACE -fno-common -pipe -fno-common -c libpq-compat.c
libpq-compat.c: In function ‘PQescapeBytea’:
libpq-compat.c:104: warning: incompatible implicit declaration of built-in function ‘sprintf’
libpq-compat.c: In function ‘PQunescapeBytea’:
libpq-compat.c:158: warning: incompatible implicit declaration of built-in function ‘strlen’
libpq-compat.c: In function ‘PQescapeBytea’:
libpq-compat.c:104: warning: incompatible implicit declaration of built-in function ‘sprintf’
libpq-compat.c: In function ‘PQunescapeBytea’:
libpq-compat.c:158: warning: incompatible implicit declaration of built-in function ‘strlen’
gcc -I. -I. -I/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/universal-darwin10.0 -I. -DHAVE_LIBPQ_FE_H -DHAVE_LIBPQ_LIBPQ_FS_H -I/Library/PostgreSQL/8.4/include -D_XOPEN_SOURCE -D_DARWIN_C_SOURCE -fno-common -arch i386 -arch x86_64 -g -Os -pipe -fno-common -DENABLE_DTRACE -fno-common -pipe -fno-common -c postgres.c
postgres.c:41: error: static declaration of ‘PQserverVersion’ follows non-static declaration
/Library/PostgreSQL/8.4/include/libpq-fe.h:289: error: previous declaration of ‘PQserverVersion’ was here
postgres.c: In function ‘Init_postgres’:
postgres.c:2676: error: ‘pgconn_protocol_version’ undeclared (first use in this function)
postgres.c:2676: error: (Each undeclared identifier is reported only once
postgres.c:2676: error: for each function it appears in.)
postgres.c:2677: error: ‘pgconn_server_version’ undeclared (first use in this function)
postgres.c:41: error: static declaration of ‘PQserverVersion’ follows non-static declaration
/Library/PostgreSQL/8.4/include/libpq-fe.h:289: error: previous declaration of ‘PQserverVersion’ was here
postgres.c: In function ‘Init_postgres’:
postgres.c:2676: error: ‘pgconn_protocol_version’ undeclared (first use in this function)
postgres.c:2676: error: (Each undeclared identifier is reported only once
postgres.c:2676: error: for each function it appears in.)
postgres.c:2677: error: ‘pgconn_server_version’ undeclared (first use in this function)
lipo: can't open input file: /var/tmp//ccpTMtE2.out (No such file or directory)
make: *** [postgres.o] Error 1
Gem files will remain installed in /Library/Ruby/Gems/1.8/gems/postgres-0.7.9.2008.01.28 for inspection.
Results logged to /Library/Ruby/Gems/1.8/gems/postgres-0.7.9.2008.01.28/ext/gem_make.out
I am using Mac OS 10.6.4 and Postgres version 8.4.
And idea what could be happening here or how to fix it?
Looks like you're using the EnterpriseDB distribution of Posgres so you need to do this on Snow Leopard:
$ export ARCHFLAGS='-arch i386'
$ sudo gem install pg -- --with-pg-config=/Library/PostgreSQL/8.4/bin/pg_config