Question: Unable to rake db:create with gem pg_jruby

Question

Unable to rake db:create with gem pg_jruby

Answers 0
Added at 2016-11-08 00:11
Tags
Question

I'm trying to setup a postgres db with jruby using pg_jruby.

When i run 'rake:db create' I get an error saying

C:/jruby-9.1.5.0/lib/ruby/gems/shared/gems/paperclip-4.2.4/lib/paperclip/storage/filesystem.rb:49: warning: `&' after local variable or literal is interpreted as binary operator
C:/jruby-9.1.5.0/lib/ruby/gems/shared/gems/paperclip-4.2.4/lib/paperclip/storage/filesystem.rb:49: warning: even though it seems like argument prefix
undefined method `conndefaults_hash' for PG::Connection:Class
Did you mean?  connectdefaults
Couldn't create database for {"adapter"=>"postgresql", "pool"=>5, "timeout"=>5000, "database"=>"development_db"}
rake aborted!
NoMethodError: undefined method `conndefaults_hash' for PG::Connection:Class
Did you mean?  connectdefaults
c:\jruby-9.1.5.0\bin\rake:22:in `<main>'
Tasks: TOP => db:create

Gemfile line requiring pg_jruby

# as there is no .gemspec in the source.
gem 'pg', '0.18', :platform => :jruby, :git => 'git://github.com/headius/jruby-pg.git', :branch => :master

database.yml

# SQLite version 3.x
#   gem install sqlite3
#
#   Ensure the SQLite 3 gem is defined in your Gemfile
#   gem 'sqlite3'
#
default: &default
  adapter: postgresql
  pool: 5
  timeout: 5000

development:
  <<: *default
  database: development_db

# Warning: The database defined as "test" will be erased and
# re-generated from your development database when you run "rake".
# Do not set this db to the same as development or production.
test:
  <<: *default
  database: test_db

production:
  <<: *default
  database: production_db
Answers
Source Show
◀ Wstecz