Error Installing ruby gem for PostgreSQL - ruby-on-rails

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

Related

Error installing bcrypt-ruby

I have run the command:
gem install bcrypt '3.1.7'.
Unfortunately the gem fails to install. Instead I get the following output:
Fetching: bcrypt-3.1.7.gem (100%)
Building native extensions. This could take a while...
ERROR: Error installing bcrypt-ruby:
ERROR: Failed to build gem native extension.
/usr/local/rvm/rubies/ruby-1.8.7-head/bin/ruby extconf.rb
checking for ruby/util.h... yes
creating Makefile
make
gcc -I. -I/usr/local/rvm/rubies/ruby-1.8.7-head/lib/ruby/1.8/x86_64-linux -I/usr/local/rvm/rubies/ruby-1.8.7-head/lib/ruby/1.8/x86_64-linux -I. -DHAVE_RUBY_UTIL_H -fPIC -O2 -fno-tree
-dce -fno-optimize-sibling-calls -fPIC -c crypt.c
gcc -I. -I/usr/local/rvm/rubies/ruby-1.8.7-head/lib/ruby/1.8/x86_64-linux -I/usr/local/rvm/rubies/ruby-1.8.7-head/lib/ruby/1.8/x86_64-linux -I. -DHAVE_RUBY_UTIL_H -fPIC -O2 -fno-tree
-dce -fno-optimize-sibling-calls -fPIC -c crypt_gensalt.c
gcc -I. -I/usr/local/rvm/rubies/ruby-1.8.7-head/lib/ruby/1.8/x86_64-linux -I/usr/local/rvm/rubies/ruby-1.8.7-head/lib/ruby/1.8/x86_64-linux -I. -DHAVE_RUBY_UTIL_H -fPIC -O2 -fno-tree
-dce -fno-optimize-sibling-calls -fPIC -c crypt_blowfish.c
gcc -I. -I/usr/local/rvm/rubies/ruby-1.8.7-head/lib/ruby/1.8/x86_64-linux -I/usr/local/rvm/rubies/ruby-1.8.7-head/lib/ruby/1.8/x86_64-linux -I. -DHAVE_RUBY_UTIL_H -fPIC -O2 -fno-tree
-dce -fno-optimize-sibling-calls -fPIC -c bcrypt_ext.c
gcc -I. -I/usr/local/rvm/rubies/ruby-1.8.7-head/lib/ruby/1.8/x86_64-linux -I/usr/local/rvm/rubies/ruby-1.8.7-head/lib/ruby/1.8/x86_64-linux -I. -DHAVE_RUBY_UTIL_H -fPIC -O2 -fno-tree
-dce -fno-optimize-sibling-calls -fPIC -c wrapper.c
In file included from /usr/include/ruby/util.h:22:0,
from wrapper.c:28:
/usr/include/ruby/defines.h:71:7: error: conflicting types for ‘ruby_xmalloc’
void *xmalloc(size_t);
^
In file included from /usr/local/rvm/rubies/ruby-1.8.7-head/lib/ruby/1.8/x86_64-linux/ruby.h:37:0,
from wrapper.c:26:
/usr/local/rvm/rubies/ruby-1.8.7-head/lib/ruby/1.8/x86_64-linux/defines.h:49:7: note: previous declaration of ‘ruby_xmalloc’ was here
void *xmalloc _((long));
^
In file included from /usr/include/ruby/util.h:22:0,
from wrapper.c:28:
/usr/include/ruby/defines.h:73:7: error: conflicting types for ‘ruby_xcalloc’
void *xcalloc(size_t,size_t);
^
In file included from /usr/local/rvm/rubies/ruby-1.8.7-head/lib/ruby/1.8/x86_64-linux/ruby.h:37:0,
from wrapper.c:26:
/usr/local/rvm/rubies/ruby-1.8.7-head/lib/ruby/1.8/x86_64-linux/defines.h:50:7: note: previous declaration of ‘ruby_xcalloc’ was here
void *xcalloc _((long,long));
^
In file included from /usr/include/ruby/util.h:22:0,
from wrapper.c:28:
/usr/include/ruby/defines.h:74:7: error: conflicting types for ‘ruby_xrealloc’
void *xrealloc(void*,size_t);
^
In file included from /usr/local/rvm/rubies/ruby-1.8.7-head/lib/ruby/1.8/x86_64-linux/ruby.h:37:0,
from wrapper.c:26:
/usr/local/rvm/rubies/ruby-1.8.7-head/lib/ruby/1.8/x86_64-linux/defines.h:51:7: note: previous declaration of ‘ruby_xrealloc’ was here
void *xrealloc _((void*,long));
^
make: *** [wrapper.o] Error 1
Gem files will remain installed in /usr/local/rvm/gems/ruby-1.8.7-head/gems/bcrypt-3.1.7 for inspection.
Results logged to /usr/local/rvm/gems/ruby-1.8.7-head/gems/bcrypt-3.1.7/ext/mri/gem_make.out
ERROR: Could not find a valid gem '3.1.5' (>= 0) in any repository
This is basically a rather spurious outpouring of problems from 'make' failing to complete. I have found a lot of people have had problems installing bcrypt but none of the suggestions they use solve this particular problem.
How can I solve this problem?
After a closer look at the output, I noticed the list of errors are paired. It looks like they are seperate errors however, they are actually in pairs based on the conflict mentioned in the output. Each pair is referring to two different directories, each corresponding to a different installation of ruby.
After removing the system installed version (ie through 'yum') and leaving the rvm installed version, then running the gem install command, the problem is solved.

Installing Capybara-webkit on Fedora

So I'm on Fedora 17 trying to install Capybara Webkit. I followed the directions here and did a bundle install for another (near-identical) branch of this project, so I know it works.
When I try to bundle install, it has this error. Anyone have thoughts, or should I just log a bug with co?
Installing capybara-webkit (0.12.1)
Gem::Installer::ExtensionBuildError: ERROR: Failed to build gem native extension.
-- SNIP --
g++ -c -pipe -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fstack-protector --param=ssp-buffer-size=4 -m32 -march=i686 -mtune=atom -fasynchronous-unwind-tables -O2 -Wall -W -D_REENTRANT -DQT_NO_DEBUG -DQT_WEBKIT_LIB -DQT_GUI_LIB -DQT_NETWORK_LIB -DQT_CORE_LIB -DQT_SHARED -I/usr/lib/qt4/mkspecs/linux-g++ -I. -I/usr/include/QtCore -I/usr/include/QtNetwork -I/usr/include/QtGui -I/usr/include/QtWebKit -I/usr/include -I. -o WebPage.o
WebPage.cpp
WebPage.cpp: In member function ‘bool WebPage::render(const QString&)’:
WebPage.cpp:148:3: error: ‘QFileInfo’ was not declared in this scope
WebPage.cpp:148:13: error: expected ‘;’ before ‘fileInfo’
WebPage.cpp:149:3: error: ‘QDir’ was not declared in this scope
WebPage.cpp:149:8: error: expected ‘;’ before ‘dir’
WebPage.cpp:150:3: error: ‘dir’ was not declared in this scope
WebPage.cpp:150:14: error: ‘fileInfo’ was not declared in this scope
make[1]: *** [WebPage.o] Error 1
make[1]: Leaving directory `/usr/local/rvm/gems/ruby-1.9.3-p286/gems/capybara-webkit-0.12.1/src'
make: *** [sub-src-webkit_server-pro-make_default-ordered] Error 2
make
cd src/ && make -f Makefile.webkit_server
make[1]: Entering directory `/usr/local/rvm/gems/ruby-1.9.3-p286/gems/capybara-webkit-0.12.1/src'
g++ -c -pipe -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fstack-protector --param=ssp-buffer-size=4 -m32 -march=i686 -mtune=atom -fasynchronous-unwind-tables -O2 -Wall -W -D_REENTRANT -DQT_NO_DEBUG -DQT_WEBKIT_LIB -DQT_GUI_LIB -DQT_NETWORK_LIB -DQT_CORE_LIB -DQT_SHARED -I/usr/lib/qt4/mkspecs/linux-g++ -I. -I/usr/include/QtCore -I/usr/include/QtNetwork -I/usr/include/QtGui -I/usr/include/QtWebKit -I/usr/include -I. -o WebPage.o WebPage.cpp
WebPage.cpp: In member function ‘bool WebPage::render(const QString&)’:
WebPage.cpp:148:3: error: ‘QFileInfo’ was not declared in this scope
WebPage.cpp:148:13: error: expected ‘;’ before ‘fileInfo’
WebPage.cpp:149:3: error: ‘QDir’ was not declared in this scope
WebPage.cpp:149:8: error: expected ‘;’ before ‘dir’
WebPage.cpp:150:3: error: ‘dir’ was not declared in this scope
WebPage.cpp:150:14: error: ‘fileInfo’ was not declared in this scope
make[1]: *** [WebPage.o] Error 1
make[1]: Leaving directory `/usr/local/rvm/gems/ruby-1.9.3-p286/gems/capybara-webkit-0.12.1/src'
make: *** [sub-src-webkit_server-pro-make_default-ordered] Error 2
Gem files will remain installed in /usr/local/rvm/gems/ruby-1.9.3-p286/gems/capybara-webkit-0.12.1 for inspection.
Results logged to /usr/local/rvm/gems/ruby-1.9.3-p286/gems/capybara-webkit-0.12.1/./gem_make.out
An error occurred while installing capybara-webkit (0.12.1), and Bundler cannot
continue.
Make sure that gem install capybara-webkit -v '0.12.1' succeeds before
bundling.
version 0.12.1 is quite an outdated version of the gem - I had a lot of trouble getting a similar version installed for an older project I had.
I recommend upgrading to a newer version - the dependencies will be newer and the installation will be a lot less hassle.
capybara-webkit depends on a WebKit implementation from Qt, a cross-platform development toolkit. You'll need to download the Qt libraries to build and install the gem. Instructions for downloading and installing QT: https://github.com/thoughtbot/capybara-webkit/wiki/Installing-Qt-and-compiling-capybara-webkit

Unable to update cocoapods

Prior to trying to update my cocoapods I was on:
pod --version
0.22.3
Whenever I do a pod install I see the following message in my console:
CocoaPods 0.26.2 is available.
However every time I try to update Cocoapods it does not seem to work:
$ sudo gem install cocoapods
Building native extensions. This could take a while...
ERROR: Error installing cocoapods:
ERROR: Failed to build gem native extension.
/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/bin/ruby extconf.rb
checking for -std=c99 option to compiler... yes
checking for CoreFoundation... yes
checking for CoreFoundation/CoreFoundation.h... yes
checking for CoreFoundation/CFStream.h... yes
checking for CoreFoundation/CFPropertyList.h... yes
checking for ruby/st.h... yes
creating extconf.h
creating Makefile
make
xcrun cc -I. -I. -I/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/universal-darwin12.0 -I. -DRUBY_EXTCONF_H=\"extconf.h\" -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 -std=c99 -c xcodeproj_ext.c
xcrun: Error: could not stat active Xcode path '/Volumes/Xcode/Xcode.app/Contents/Developer'. (No such file or directory)
cc -arch i386 -arch x86_64 -pipe -bundle -undefined dynamic_lookup -o xcodeproj_ext.bundle xcodeproj_ext.o -L. -L/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib -L. -arch i386 -arch x86_64 -ObjC -framework CoreFoundation -lruby -lpthread -ldl -lobjc
clang: error: no such file or directory: 'xcodeproj_ext.o'
make: *** [xcodeproj_ext.bundle] Error 1
Gem files will remain installed in /Library/Ruby/Gems/1.8/gems/xcodeproj-0.13.1 for inspection.
Results logged to /Library/Ruby/Gems/1.8/gems/xcodeproj-0.13.1/ext/xcodeproj/gem_make.out
pod --version
0.22.3
It looks like you are using Xcode from a volume and not from an installed copy on disk. It is trying to find xcode at the following path
/Volumes/Xcode/Xcode.app/Contents/Developer'. (No such file or directory)
Are you using xcode from a disk image? If not, you need to switch the active version of xcode using this command:
sudo xcode-select -switch /Applications/Xcode.app
xcrun: Error: could not stat active Xcode path '/Volumes/Xcode/Xcode45-DP1.app/Contents/Developer'. (No such file or directory)
I'm going to assume you're running Mavericks, in which case there were some changes made to Ruby. This gist is slightly outdated, but the steps you could try are...
Step 1) Make sure you have the most recent version of Xcode, as the command line tools are now packaged with it. (so as of 10/23/13, that'd be version 5.0.1).
Step 2) Run each of the following commands in Terminal...
sys_rb_usr=/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr
sdk_rb_usr=`xcode-select -p`/SDKs/MacOSX10.9.sdk/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr
sudo cp -r $sdk_rb_usr/include $sys_rb_usr/include
Then try running sudo gem install cocoapods again.
Hope that helps.
--UPDATE--: I was having the same error message, while running Mavericks and Xcode 5.0. After updating Xcode to 5.0.1, I was able to update Cocoapods to 0.26.2. You shouldn't have to run the above commands.

Erros while installing 'therubyracer-heroku' gem

I am trying to do a gem install therubyracer-heroku -v '0.8.1.pre3', but I am getting errors while building, it is a big log but here is the last failing lines (pasted full log in the end):
g++ -o obj/release/bootstrapper.o -c -Wall -Werror -W -Wno-unused-parameter -Wnon-virtual-dtor -pedantic -m32 -O3 -fomit-frame-pointer -fdata-sections -ffunction-sections -ansi -fno-rtti -fno-exceptions -fvisibility=hidden -Wall -Werror -W -Wno-unused-parameter -Wnon-virtual-dtor -pedantic -m32 -O3 -fomit-frame-pointer -fdata-sections -ffunction-sections -ansi -DV8_TARGET_ARCH_IA32 -DENABLE_VMSTATE_TRACKING -DENABLE_LOGGING_AND_PROFILING -DENABLE_DEBUGGER_SUPPORT -Isrc src/bootstrapper.cc
src/bootstrapper.cc: In static member function 'static bool v8::internal::Genesis::CompileScriptCached(v8::internal::Vector<const char>, v8::internal::Handle<v8::internal::String>, v8::internal::SourceCodeCache*, v8::Extension*, v8::internal::Handle<v8::internal::Context>, bool)':
src/bootstrapper.cc:1002:18: error: variable 'result' set but not used [-Werror=unused-but-set-variable]
src/bootstrapper.cc: In member function 'bool v8::internal::Genesis::InstallNatives()':
src/bootstrapper.cc:1227:24: error: variable 'name' set but not used [-Werror=unused-but-set-variable]
cc1plus: all warnings being treated as errors
scons: *** [obj/release/bootstrapper.o] Error 1
scons: building terminated because of errors.
make: *** [build/v8/libv8.a] Error 2
*** 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.
I have googled about his for many hours and looked into a lot of SO similar questions, but nothing helped, also I don't know what is mkmf log mean and where to find it.
Additional information:
OS: Ubuntu, 12.04
I already have nodeJs installed, version is v0.8.14 (Just giving this info, since it may be linked with this)
Ruby version: 1.9.3
RVM is used

Yet another "installing pg gem" issue on Mac

So, I've just spent the best part of the day trying to get Rails (and required gems) to install correctly.
After hours with line cache and nokogiri I'm just starting to feel drained and have now come up with a problem installing the 'pg' gem.
I'm going to continue battling on but any advice here with this problem?
(And I know I shouldn't ask two questions in 1 SO post but I'm going to anyway. I've installed vast amounts of software in the past (including compiling Linux kernels from scratch) and Rails seems inordinately difficult to install on Snow Leopard. On a par with getting Linux display drivers working in the bad old days. Is there any progress being made anywhere on making this process simpler?)
Error log is:
Using linecache19 (0.5.12)
Installing nokogiri (1.5.0) with native extensions
Installing pg (0.12.2) with native extensions
Gem::Installer::ExtensionBuildError: ERROR: Failed to build gem native extension.
/Users/user/.rvm/rubies/ruby-1.9.2-p318/bin/ruby extconf.rb
checking for pg_config... yes
Using config values from /usr/bin/pg_config
checking for libpq-fe.h... yes
checking for libpq/libpq-fs.h... yes
checking for PQconnectdb() in -lpq... yes
checking for PQconnectionUsedPassword()... yes
checking for PQisthreadsafe()... yes
checking for PQprepare()... yes
checking for PQexecParams()... yes
checking for PQescapeString()... yes
checking for PQescapeStringConn()... yes
checking for PQgetCancel()... yes
checking for lo_create()... yes
checking for pg_encoding_to_char()... yes
checking for PQsetClientEncoding()... yes
checking for rb_encdb_alias()... yes
checking for rb_enc_alias()... yes
checking for struct pgNotify.extra in libpq-fe.h... yes
checking for unistd.h... yes
checking for ruby/st.h... yes
creating extconf.h
creating Makefile
make
/usr/bin/gcc-4.2 -I. -I/Users/user/.rvm/rubies/ruby-1.9.2-p318/include/ruby-1.9.1/x86_64-darwin11.3.0 -I/Users/user/.rvm/rubies/ruby-1.9.2-p318/include/ruby-1.9.1/ruby/backward -I/Users/user/.rvm/rubies/ruby-1.9.2-p318/include/ruby-1.9.1 -I. -DRUBY_EXTCONF_H=\"extconf.h\" -I/Users/user/.rvm/usr/include -D_XOPEN_SOURCE -D_DARWIN_C_SOURCE -I/usr/include -fno-common -O3 -ggdb -Wextra -Wno-unused-parameter -Wno-parentheses -Wpointer-arith -Wwrite-strings -Wno-missing-field-initializers -Wshorten-64-to-32 -Wno-long-long -fno-common -pipe -o compat.o -c compat.c
/usr/bin/gcc-4.2 -I. -I/Users/user/.rvm/rubies/ruby-1.9.2-p318/include/ruby-1.9.1/x86_64-darwin11.3.0 -I/Users/user/.rvm/rubies/ruby-1.9.2-p318/include/ruby-1.9.1/ruby/backward -I/Users/user/.rvm/rubies/ruby-1.9.2-p318/include/ruby-1.9.1 -I. -DRUBY_EXTCONF_H=\"extconf.h\" -I/Users/user/.rvm/usr/include -D_XOPEN_SOURCE -D_DARWIN_C_SOURCE -I/usr/include -fno-common -O3 -ggdb -Wextra -Wno-unused-parameter -Wno-parentheses -Wpointer-arith -Wwrite-strings -Wno-missing-field-initializers -Wshorten-64-to-32 -Wno-long-long -fno-common -pipe -o pg.o -c pg.c
pg.c: In function ‘pgconn_exec’:
pg.c:954: warning: implicit conversion shortens 64-bit value into a 32-bit value
pg.c:993: warning: implicit conversion shortens 64-bit value into a 32-bit value
pg.c: In function ‘pgconn_prepare’:
pg.c:1059: warning: implicit conversion shortens 64-bit value into a 32-bit value
pg.c: In function ‘pgconn_exec_prepared’:
pg.c:1150: warning: implicit conversion shortens 64-bit value into a 32-bit value
pg.c:1180: warning: implicit conversion shortens 64-bit value into a 32-bit value
pg.c: In function ‘pgconn_s_escape’:
pg.c:1324: warning: implicit conversion shortens 64-bit value into a 32-bit value
pg.c:1331: warning: implicit conversion shortens 64-bit value into a 32-bit value
pg.c: In function ‘pgconn_send_query’:
pg.c:1504: warning: implicit conversion shortens 64-bit value into a 32-bit value
pg.c:1543: warning: implicit conversion shortens 64-bit value into a 32-bit value
pg.c: In function ‘pgconn_send_prepare’:
pg.c:1608: warning: implicit conversion shortens 64-bit value into a 32-bit value
pg.c: In function ‘pgconn_send_query_prepared’:
pg.c:1697: warning: implicit conversion shortens 64-bit value into a 32-bit value
pg.c:1728: warning: implicit conversion shortens 64-bit value into a 32-bit value
pg.c: In function ‘pgconn_wait_for_notify’:
pg.c:2103: warning: implicit conversion shortens 64-bit value into a 32-bit value
pg.c: In function ‘pgconn_put_copy_data’:
pg.c:2173: warning: implicit conversion shortens 64-bit value into a 32-bit value
pg.c: In function ‘pgconn_block’:
pg.c:2586: warning: implicit conversion shortens 64-bit value into a 32-bit value
pg.c:2592: warning: format not a string literal and no format arguments
pg.c:2607: warning: format not a string literal and no format arguments
pg.c: In function ‘pgconn_locreate’:
pg.c:2870: warning: implicit conversion shortens 64-bit value into a 32-bit value
pg.c: In function ‘find_or_create_johab’:
pg.c:3940: warning: comparison between signed and unsigned
pg.c:3946: warning: comparison between signed and unsigned
pg.c: In function ‘pgconn_get_client_encoding_as_rb_encoding’:
pg.c:3974: warning: comparison between signed and unsigned
pg.c: In function ‘pgconn_get_rb_encoding_as_pg_encname’:
pg.c:4006: warning: comparison between signed and unsigned
pg.c: In function ‘pgconn_internal_encoding_set’:
pg.c:4065: warning: comparison between signed and unsigned
pg.c: In function ‘pgconn_external_encoding’:
pg.c:4121: warning: comparison between signed and unsigned
/usr/bin/gcc-4.2 -dynamic -bundle -o pg_ext.bundle compat.o pg.o -L. -L/Users/user/.rvm/rubies/ruby-1.9.2-p318/lib -L/Users/user/.rvm/usr/lib -L. -L/usr/local/lib -L/usr/lib -Wl,-undefined,dynamic_lookup -Wl,-multiply_defined,suppress -Wl,-flat_namespace -lruby.1.9.1 -lpq -lpthread -ldl -lobjc
ld: in /usr/local/lib/libssl.0.9.8.dylib, missing required architecture x86_64 in file for architecture x86_64
collect2: ld returned 1 exit status
make: *** [pg_ext.bundle] Error 1
Gem files will remain installed in /Users/user/.rvm/gems/ruby-1.9.2-p318/gems/pg-0.12.2 for inspection.
Results logged to /Users/user/.rvm/gems/ruby-1.9.2-p318/gems/pg-0.12.2/ext/gem_make.out
An error occured while installing pg (0.12.2), and Bundler cannot continue.
Make sure that `gem install pg -v '0.12.2'` succeeds before bundling.
Is there any progress being made anywhere on making this process simpler?)
Yes: Yehuda Katz is leading a Kickstarter project to help:
http://www.kickstarter.com/projects/1397300529/railsapp
Looks like you may have an old openssl.
Try this:
sudo port selfupdate
View the list of outdated ports:
port outdated
Clean up outdated ports:
sudo port clean outdated
sudo port upgrade outdated
See if you have any libssl:
find / | grep libssl.*dylib
Try installing postgresql from a Mac download:
http://www.postgresql.org/download/macosx/
Then try installing the gem as usual:
gem install pg
Or if you use sudo do:
sudo gem install pg
Normally this is a 64bit/32bit issue resp. a mismatch between your ruby version and your Postgresql Installation.
Depending on your architecture you have to make use of the correct ARCH flags.
Please see this answer on stackoverflow.
Generally I have little to no problems using "homebrew" and RVM
HTH

Resources