I have some troubles with installing my Postgres gem. When I run:
gem install pg -v '0.19.0'
it prints:
Successfully installed pg-0.19.0
Parsing documentation for pg-0.19.0
Done installing documentation for pg after 2 seconds
1 gem installed
but when I run:
bundle install
it stops on the pg gem and prints:
An error occurred while installing pg (0.19.0), and Bundler cannot continue.
Make sure that `gem install pg -v '0.19.0'` succeeds before bundling.
The whole log is:
sh: /usr/pgsql-9.1/bin/pg_config: No such file or directory
sh: /usr/pgsql-9.1/bin/pg_config: No such file or directory
checking for libpq-fe.h... no
Can't find the 'libpq-fe.h header
*** 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.
gem env
outputs:
/ruby/2.3.0/rubygems/commands/environment_command.rb:154: warning: Insecure world writable dir /usr/local/bin in PATH, mode 040777
RubyGems Environment:
- RUBYGEMS VERSION: 2.5.1
- RUBY VERSION: 2.3.0 (2015-12-25 patchlevel 0) [x86_64-darwin16]
- INSTALLATION DIRECTORY: /.rvm/gems/ruby-2.3.0
- USER INSTALLATION DIRECTORY: /.gem/ruby/2.3.0
- RUBY EXECUTABLE: /.rvm/rubies/ruby-2.3.0/bin/ruby
- EXECUTABLE DIRECTORY: /.rvm/gems/ruby-2.3.0/bin
- SPEC CACHE DIRECTORY: /.gem/specs
- SYSTEM CONFIGURATION DIRECTORY: /.rvm/rubies/ruby-2.3.0/etc
- RUBYGEMS PLATFORMS:
- ruby
- x86_64-darwin-16
- GEM PATHS:
- /.rvm/gems/ruby-2.3.0
- /.rvm/gems/ruby-2.3.0@global
- GEM CONFIGURATION:
- :update_sources => true
- :verbose => true
- :backtrace => false
- :bulk_threshold => 1000
- REMOTE SOURCES:
- https://rubygems.org/
- SHELL PATH:
- /.rvm/gems/ruby-2.3.0/bin
- /.rvm/gems/ruby-2.3.0@global/bin
- /.rvm/rubies/ruby-2.3.0/bin
- /.rvm/bin
- /usr/local/bin
- /usr/bin
- /bin
- /usr/sbin
- /sbin