I\'m new to Ruby (coming from a Java background) and was given access to a RoR project from a Git repository. I was able to get Ruby built with rbenv and Postgres installed
I'm curious if you installed the pg gem before or after installing postgres via brew?
If pg was installed before you installed Postgres via brew, you may need to remove it and install it again so that it's compiled against your current version of Postgres.
Side note: postgresapp is a much better alternative to installing postgres via homebrew: http://postgresapp.com/
Issue also appears in Fedora 17.
Uninstall "pg" gem:
gem uninstall pg
Run bundle (assuming Gemfile contains "pg" gem):
bundle
Add the pg gem to your Gemfile
. Then run:
bundle install
bundle update
I've already installed the pg gem list pg
I also encountered this problem and I made it work.
First, you run the command:
$ gem install pg --pre
Successfully installed pg-0.21.0-x64-mingw32
Next, you update your Gemfile: gem 'pg', '~> 0.21.0'. That's it.
My rubygems environment are as follow:
RubyGems Environment:
- RUBYGEMS VERSION: 2.6.12
- RUBY VERSION: 2.3.3 (2016-11-21 patchlevel 222) [x64-mingw32]
- INSTALLATION DIRECTORY: C:/Ruby23-x64/lib/ruby/gems/2.3.0
- USER INSTALLATION DIRECTORY: C:/Users/armano/.gem/ruby/2.3.0
- RUBY EXECUTABLE: C:/Ruby23-x64/bin/ruby.exe
- EXECUTABLE DIRECTORY: C:/Ruby23-x64/bin
- SPEC CACHE DIRECTORY: C:/Users/armano/.gem/specs
- SYSTEM CONFIGURATION DIRECTORY: C:/ProgramData
- RUBYGEMS PLATFORMS:
- ruby
- x64-mingw32
- GEM PATHS:
- C:/Ruby23-x64/lib/ruby/gems/2.3.0
- C:/Users/armano/.gem/ruby/2.3.0
- GEM CONFIGURATION:
- :update_sources => true
- :verbose => true
- :backtrace => false
- :bulk_threshold => 1000
- "gem" => "--no-ri --no-rdoc"
- REMOTE SOURCES:
- https://rubygems.org/
If during the installation of the gem the pq installation is not in path so it could not be found by the gem. Than the gem would not work correct.
psql
from commandline). gem unistall pg
bundle install
or gem install pg