寶石文件:耙子中止!寶石:: LoadError:指定「PostgreSQL的數據庫適配器上軌分貝:遷移
source 'https://rubygems.org'
gem 'rails', '5.0.1'
gem 'bcrypt', '3.1.11'
gem 'puma', '3.4.0'
gem 'sass-rails', '5.0.6'
gem 'uglifier', '3.0.0'
gem 'coffee-rails', '4.2.1'
gem 'jquery-rails', '4.1.1'
gem 'turbolinks', '5.0.1'
gem 'jbuilder', '2.4.1'
gem 'bootstrap-sass', '3.3.6'
gem 'unicorn'
group :development, :test do
gem 'sqlite3', '1.3.12'
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 :test do
gem 'rails-controller-testing', '0.1.1'
gem 'minitest-reporters', '1.1.9'
gem 'guard', '2.13.0'
gem 'guard-minitest', '2.4.4'
end
group :production do
gem 'pg', '0.18.4'
end
# Windows does not include zoneinfo files, so bundle the tzinfo-data gem
gem 'tzinfo-data', platforms: [:mingw, :mswin, :x64_mingw, :jruby]
database.yml中:運行耙分貝時
default: &default
adapter: sqlite3
pool: 5
timeout: 5000
development:
<<: *default
database: db/development.sqlite3
# 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/test.sqlite3
production:
<<: *default
database: db/production.sqlite3
遷移失敗:遷移。 嘗試使用RAILS_ENV =開發將環境變量設置爲開發仍然失敗。我在生產中使用postgres,因爲heroku提供了postgres。兩者都給出了gem文件和database.yml。
編輯: 我試圖克隆回購到另一臺機器,並試圖它工作正常。
感謝大家,問題出在我的本地機器上,因爲我最近在沒有brew的情況下安裝了Postgres。一旦我卸載rhat並重新啓動遷移成功。 – Aditya