Specified 'sqlite3' for database adapter, but the gem is not loaded.
Add gem 'sqlite3' to your Gemfile (and ensure its version is at the
minimum required by ActiveRecord).
Add gem 'sqlite3', group: :development
to your Gemfile
and do bundle install
.
And also you should be putting pg gem
in a production group like this for you to avoid further conflicts in local
#Gemfile
group :production do
gem 'pg', '0.17.1'
end
OR
gem 'pg', '0.17.1', group: :production
AND
gem 'sqlite3', group: :development
Update #1
And also, you should edit your database.yml
to specify different adapters for development
and production
like this
#database.yml
development:
adapter: sqlite3
database: your_db
username: your_username
password: your_pass
-----
-----
production:
adapter: postgresql
database: your_production_db
username: your_production_username
password: your_production_pass
------
------
Update #2
FATAL: Peer authentication failed for user "postgres"
If you set a password based authentication, then you need to do below steps
1.Open the file pg_hba.conf
for Ubuntu it will be in /etc/postgresql/9.x/main
and change the this line:
local all postgres peer
to
local all postgres md5
2.Restart the server
sudo service postgresql restart
3.Login into psql and set your password
psql -U postgres
ALTER USER postgres with password 'your-pass'; #as in your database.yml