Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Error loading the 'postgresql' Active Record adapter. Missing a gem it depends on? pg is not part of the bundle. Add it to your Gemfile

Tags:

gemfile

Gemfile

source 'https://rubygems.org'
git_source(:github) { |repo| "https://github.com/#{repo}.git" }
Ruby '2.3.3'
gem 'rails', '~> 5.2.1'
gem 'bootstrap-sass', '3.3.7'
gem 'puma', '~> 3.11'
gem 'sass-rails', '~> 5.0'
gem 'uglifier', '>= 1.3.0'
gem 'duktape'
gem 'coffee-rails', '~> 4.2'
gem 'turbolinks', '~> 5'
gem 'jbuilder', '~> 2.5'
#gem 'redis', '~> 4.0'
gem 'bcrypt', '3.1.12'
#gem 'mini_magick', '~> 4.8'
#gem 'capistrano-rails', group: :development
gem 'bootsnap', '>= 1.1.0', require: false
group :development, :test do
end
gem 'byebug', platforms: [:mri, :mingw, :x64_mingw]
end
group :development do
gem 'web-console', '>= 3.3.0'
end
group :test do
gem 'rails-controller-testing', '1.0.2'
gem 'minitest',                 '5.10.3'
gem 'minitest-reporters',       '1.1.14'
gem 'guard',                    '2.13.0'
gem 'guard-minitest',           '2.4.4'
gem 'capybara', '>= 2.15'
gem 'selenium-webdriver'
gem 'chromedriver-helper'
end
group :production do
gem 'pg', '0.18.4'
end
gem 'tzinfo-data', platforms: [:mingw,:mswin,:x64_mingw, :jruby]

    source 'https://rubygems.org'
git_source(:github) { |repo| "https://github.com/#{repo}.git" }
uby '2.3.3'
gem 'rails', '~> 5.2.1'
gem 'bootstrap-sass', '3.3.7'
gem 'puma', '~> 3.11'
gem 'sass-rails', '~> 5.0'
gem 'uglifier', '>= 1.3.0'
gem 'duktape'
gem 'coffee-rails', '~> 4.2'
gem 'turbolinks', '~> 5'
gem 'jbuilder', '~> 2.5'
#gem 'redis', '~> 4.0'
gem 'bcrypt', '3.1.12'
#gem 'mini_magick', '~> 4.8'
#gem 'capistrano-rails', group: :development
gem 'bootsnap', '>= 1.1.0', require: false
group :development, :test do
end
gem 'byebug', platforms: [:mri, :mingw, :x64_mingw]
end
group :development do
gem 'web-console', '>= 3.3.0'
end
group :test do
gem 'rails-controller-testing', '1.0.2'
gem 'minitest',                 '5.10.3'
gem 'minitest-reporters',       '1.1.14'
gem 'guard',                    '2.13.0'
gem 'guard-minitest',           '2.4.4'
gem 'capybara', '>= 2.15'
gem 'selenium-webdriver'
gem 'chromedriver-helper'
end
group :production do
gem 'pg', '0.18.4'
end
gem 'tzinfo-data', platforms: [:mingw, :mswin, :x64_mingw, :jruby]
like image 801
Geetha B Avatar asked Sep 13 '18 15:09

Geetha B


1 Answers

You probably have a previous DATABASE_URL environment variable set that is pointing to postgres db. DATABASE_URL overrides RAILS_ENV.

One option is to exit your session and try again in a new session if you haven't set permanent DATABASE_URL

unset your DATABASE_URL and you should be good.

like image 97
Roshan Shah Avatar answered Sep 19 '22 22:09

Roshan Shah