0

Following the railstutorial instructions here I am getting the error:

/home/devname/.rvm/gems/ruby-2.3.1/gems/activerecord-5.0.0/lib/active_record/connection_adapters/postgresql_adapter.rb:675:in `rescue in connect': FATAL: role "devname" does not exist

I also get this if I try "rails console development".

Here is my database.yml (minus comments):

default: &default
  adapter: sqlite3
  pool: 5
  timeout: 5000

development:
  <<: *default
  database: db/development.sqlite3

test:
  <<: *default
  database: db/test.sqlite3

production:
  <<: *default
 database: db/production.sqlite3

and my gemfile:

source 'https://rubygems.org'   

gem 'rails',        '5.0.0'
gem 'puma',         '3.4.0'
gem 'sass-rails',   '5.0.5'
gem 'uglifier',     '3.0.0'
gem 'coffee-rails', '4.2.1'
gem 'jquery-rails', '4.1.1'
gem 'turbolinks',   '5.0.0'
gem 'jbuilder',     '2.4.1'

group :development, :test do
  gem 'sqlite3', '1.3.11'
  gem 'byebug',  '9.0.0', platform: :mri
end

group :development do
  gem 'web-console',           '3.1.1'
  gem 'listen',                '3.0.8'
  gem 'spring',                '1.7.2'
  gem 'spring-watcher-listen', '2.0.0'
end

group :production do
  gem 'pg', '0.18.4'
end

I am at a loss, any help much appreciated.

3
  • Add username, password to your yml file and try connecting to sqlite console using that. Looks like some permissions issue. Commented Jul 17, 2016 at 20:45
  • 1
    You could also try to stop spring bin/spring stop to make sure that the app is using the correct configuration. Commented Jul 17, 2016 at 20:48
  • @lest - that did it! thank you. not sure what to do going forward, tho. how do I tell spring how to use development? TIA Commented Jul 17, 2016 at 20:54

1 Answer 1

1

Try to run your app in development mode

rails server -e development
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.