2017-07-23 3 views
0

Ich versuche, eine neue Schienen App mit pg einzurichten. Der Edelstein installiert, aber wenn ich rails db:create laufen bekomme ich diesen Fehler in meinem Terminal:Problem mit posgresql - db: create flags Fehler

Specified 'postgresql' for database adapter, but the gem is not loaded. Add `gem 'pg'` to your Gemfile (and ensure its version is at the minimum required by ActiveRecord). 
    Couldn't create database for {"adapter"=>"postgresql", "pool"=>5, "timeout"=>5000, "database"=>"db/spaces_development"} 
    rails aborted! 
    Gem::LoadError: Specified 'postgresql' for database adapter, but the gem is not loaded. Add `gem 'pg'` to your Gemfile (and ensure its version is at the minimum required by ActiveRecord). 

Das ist mein Gemfile & database.yml hat jemand bekam eine Ahnung, was ich falsch mache?

source 'https://rubygems.org' 

git_source(:github) do |repo_name| 
    repo_name = "#{repo_name}/#{repo_name}" unless repo_name.include?("/") 
    "https://github.com/#{repo_name}.git" 
end 

ruby '2.4.1' 
# Bundle edge Rails instead: gem 'rails', github: 'rails/rails' 
gem 'rails', '~> 5.1.2' 
# Use Postgress for database 
gem 'pq', 
# Use Puma as the app server 
gem 'puma', '~> 3.7' 
# Use SCSS for stylesheets 
gem 'sass-rails', '~> 5.0' 
# Use Uglifier as compressor for JavaScript assets 
gem 'uglifier', '>= 1.3.0' 
# See https://github.com/rails/execjs#readme for more supported runtimes 
# gem 'therubyracer', platforms: :ruby 

# Use CoffeeScript for .coffee assets and views 
gem 'coffee-rails', '~> 4.2' 
# Turbolinks makes navigating your web application faster. Read more: https://github.com/turbolinks/turbolinks 
gem 'turbolinks', '~> 5' 
# Build JSON APIs with ease. Read more: https://github.com/rails/jbuilder 
gem 'jbuilder', '~> 2.5' 
# Use Redis adapter to run Action Cable in production 
# gem 'redis', '~> 3.0' 
# Use ActiveModel has_secure_password 
# gem 'bcrypt', '~> 3.1.7' 

# Use Capistrano for deployment 
# gem 'capistrano-rails', group: :development 

group :development, :test do 
    # Call 'byebug' anywhere in the code to stop execution and get a debugger console 
    gem 'byebug', platforms: [:mri, :mingw, :x64_mingw] 
    gem 'better_errors' 
    gem 'capybara-email' 
    #gem 'capybara-webkit' 
    gem 'factory_girl_rails' 
    gem 'ffaker' 
    gem 'database_cleaner' 
    gem 'letter_opener' 
    gem 'rspec-rails' 
    gem 'pry' 
    gem 'pry-nav' 
    gem 'pry-rails', '~> 0.3.2' 
    gem 'simple_bdd' 
    gem 'shoulda-matchers' 
    gem 'spring' 
end 

group :development do 
    # Access an IRB console on exception pages or by using <%= console %> anywhere in the code. 
    gem 'web-console', '>= 3.3.0' 
    gem 'listen', '>= 3.0.5', '< 3.2' 
    # Spring speeds up development by keeping your application running in the background. Read more: https://github.com/rails/spring 
    gem 'spring' 
    gem 'spring-watcher-listen', '~> 2.0.0' 
end 

# Windows does not include zoneinfo files, so bundle the tzinfo-data gem 
gem 'tzinfo-data', platforms: [:mingw, :mswin, :x64_mingw, :jruby] 

datbase.yml

default: &default 
    adapter: postgresql 
    pool: <%= ENV.fetch("RAILS_MAX_THREADS") { 5 } %> 
    timeout: 5000 

development: 
    <<: *default 
    database: db/spaces_development 

# 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: db/spaces_test 

production: 
    <<: *default 
    database: db/spaces_production 

Antwort

0

Typo: gem 'pq', ist, was Sie in Ihrem gemfile haben, während es gem 'pg'

Auch sollte nicht vergessen bundle install um sicherzustellen, dass das Schmuckstück zu laufen ist installiert und bereit zu rocken & roll

+0

Danke. Dummer Fehler ... es war ein langer Tag. – DanBonehill

+0

Gern geschehen. Mach eine Pause ;-) –