Problem with installing gems

25 views
Skip to first unread message

Elton Yau

unread,
Mar 15, 2014, 2:35:18 AM3/15/14
to rubyonra...@googlegroups.com
Hey Guys, so i recently started playing around with ROR, however whenever i try to install gems i get this message 

ERROR:  Error installing pg:
ERROR: Failed to build gem native extension.

        /Applications/rubystack-1.9.3-22/ruby/bin/ruby extconf.rb
checking for pg_config... yes
Using config values from /Applications/rubystack-1.9.3-22/postgresql/bin/pg_config
*** 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
--without-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=/Applications/rubystack-1.9.3-22/ruby/bin/ruby
--with-pg
--without-pg
--with-pg-config
--without-pg-config
--with-pg_config
--without-pg_config
--with-pg-dir
--without-pg-dir
--with-pg-include
--without-pg-include=${pg-dir}/include
--with-pg-lib
--without-pg-lib=${pg-dir}/lib
/Applications/rubystack-1.9.3-22/ruby/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 /Applications/rubystack-1.9.3-22/ruby/lib/ruby/1.9.1/mkmf.rb:461:in `try_link0'
from /Applications/rubystack-1.9.3-22/ruby/lib/ruby/1.9.1/mkmf.rb:476:in `try_link'
from extconf.rb:39:in `<main>'


Gem files will remain installed in /Applications/rubystack-1.9.3-22/ruby/lib/ruby/gems/1.9.1/gems/pg-0.17.1 for inspection.
Results logged to /Applications/rubystack-1.9.3-22/ruby/lib/ruby/gems/1.9.1/gems/pg-0.17.1/ext/gem_make.out

I dont really get whats happening ...

Thanks !

Elton

Frederick Cheung

unread,
Mar 15, 2014, 9:08:23 AM3/15/14
to rubyonra...@googlegroups.com
On Saturday, March 15, 2014 6:35:18 AM UTC, Elton Yau wrote:
> Hey Guys, so i recently started playing around with ROR, however whenever i try to install gems i get this message 
>
>
>
> ERROR:  Error installing pg:
> ERROR: Failed to build gem native extension.
>
>
>         /Applications/rubystack-1.9.3-22/ruby/bin/ruby extconf.rb
> checking for pg_config... yes
> Using config values from /Applications/rubystack-1.9.3-22/postgresql/bin/pg_config
> *** 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.
>
> /Applications/rubystack-1.9.3-22/ruby/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 /Applications/rubystack-1.9.3-22/ruby/lib/ruby/1.9.1/mkmf.rb:461:in `try_link0'
> from /Applications/rubystack-1.9.3-22/ruby/lib/ruby/1.9.1/mkmf.rb:476:in `try_link'
> from extconf.rb:39:in `<main>'
>
>



You need development tools installed (c compiler etc). Assuming you're on OS X this means installing Xcode and from within Xcode installing the command line tools (on mavericks you run xcode-select --install )

Fred.
Reply all
Reply to author
Forward
0 new messages