I generated this scaffold in Rails. Then I did a "rake db:migrate". Then I got:
[31mYou have requested:
pg >= 0
The bundle currently has pg locked at 0.18.4.
Try running `bundle update pg`[0m
[33mRun `bundle install` to install missing gems.[0m
Then I did "bundle update" and "bundle install" which resulted in:
Installing pg 0.18.4 with native extensions C:/jruby-9.0.4.0/lib/ruby/stdlib/rubygems/ext/ext_conf_builder.rb:39: warning: Tempfile#unlink or delete called on open file; ignoring
Gem::Ext::BuildError: ERROR: Failed to build gem native extension.
C:/jruby-9.0.4.0/bin/jruby.exe -r ./siteconf20151205-6108-1bkqm97.rb >extconf.rb
NotImplementedError: C extensions are not supported
<top> at C:/jruby-9.0.4.0/lib/ruby/stdlib/mkmf.rb:1
require at org/jruby/RubyKernel.java:939
(root) at C:/jruby>9.0.4.0/lib/ruby/stdlib/rubygems/core_ext/kernel_require.rb:1
<top> at extconf.rb:2
extconf failed, exit code 1
Gem files will remain installed in C:/jruby- 9.0.4.0/lib/ruby/gems/shared/gems/pg-0.18.4 for inspection.
Results logged to C:/jruby- 9.0.4.0/lib/ruby/gems/shared/extensions/universal-java-1.8/2.2.0/pg- 0.18.4/gem_make.out
An error occurred while installing pg (0.18.4), and Bundler cannot continue.
Make sure that `gem install pg -v '0.18.4'` succeeds before bundling.
In my Gemfile, I tried making "gem 'pg'" plain, then "bundle install"ing, but still got the error message.
Here's my Gemfile:
source 'https://rubygems.org'
group :production do
gem 'rails_12factor'
gem 'pg'
end
group :development, :test do
gem 'sqlite3'
end
gem 'sass-rails', '~> 4.0.3'
gem 'uglifier', '>= 1.3.0'
gem 'coffee-rails', '~> 4.0.0'
gem 'jquery-rails'
gem 'turbolinks'
gem 'jbuilder', '~> 2.0'
gem 'sdoc', '~> 0.4.0', group: :doc
gem 'tzinfo-data', platforms: [:mingw, :mswin]
gem 'coffee-script-source', '1.8.0'
Looks like you're on a Windows machine running jRuby. Try using one of the following gems instead of pg:
https://github.com/jruby/activerecord-jdbc-adapter
https://github.com/headius/jruby-pg
This answer might also be of help: unable to install pg gem