【发布时间】:2019-03-23 22:16:17
【问题描述】:
使用此命令“git push dokku master”并在 Digital Ocean 上使用 Dokku 在 Rails 上部署 ruby 时出现此错误
Could not load 'active_record/connection_adapters/mysql_adapter'.
Make sure that the adapter in config/database.yml is valid. If you
use an adapter other than 'mysql2', 'postgresql' or 'sqlite3' add
the necessary adapter gem to the Gemfile.
我已将 mysql2 添加到 Gemfile
gem 'mysql2', '~> 0.3.18'
gemfile 确保向下滚动:
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
gem 'jquery-rails'
gem 'rails', '~> 5.1.4'
gem 'puma', '~> 3.7'
gem 'sass-rails', '~> 5.0'
gem 'uglifier', '>= 1.3.0'
gem 'coffee-rails', '~> 4.2'
gem 'turbolinks', '~> 5'
gem 'jbuilder', '~> 2.5'
group :development, :test do
gem 'byebug', platforms: [:mri, :mingw, :x64_mingw]
gem 'capybara', '~> 2.13'
gem 'selenium-webdriver'
end
group :development do
gem 'web-console', '>= 3.3.0'
gem 'spring'
gem 'spring-watcher-listen', '~> 2.0.0'
end
gem 'listen', '~> 3.1.5'
gem 'tzinfo-data', platforms: [:mingw, :mswin, :x64_mingw, :jruby]
gem 'bootstrap-sass', '~> 3.3.7'
gem 'devise', '~>4.2'
gem 'toastr-rails', '~> 1.0'
gem 'omniauth', '~> 1.6'
gem 'omniauth-facebook', '~> 4.0'
gem 'paperclip', '~>5.1.0'
gem 'aws-sdk','~> 2.8'
gem 'geocoder', '~> 1.4'
gem 'geocomplete_rails'
gem 'jquery-ui-rails', '~> 5.0'
gem 'ransack', '~> 1.7'
gem 'twilio-ruby', '~> 4.11.1'
gem 'fullcalendar-rails', '~> 3.4.0'
gem 'momentjs-rails', '~> 2.17.1'
gem 'stripe', '~> 3.0.0'
gem 'rails-assets-card', source: 'https://rails-assets.org'
gem 'omniauth-stripe-connect', '~> 2.10.0'
gem 'chartkick', '~> 2.2.4'
gem 'mysql2', '~> 0.3.18'
gem 'yaml_db'
gem 'vider'
gem 'nokogiri', '1.8.3'
gem 'rails_12factor'
我有 database.yml
production:
adapter: mysql2
url: <%= ENV['DATABASE_URL'] %>
encoding: unicode
pool: 5
我运行了这个命令
dokku plugin:install https://github.com/dokku/dokku-mysql.git mysql
捆绑包 v 是 1.16.3 我运行了以下命令
bundle update
bundle install
预期结果是使以下命令行工作,这将导致成功推送到服务器
git push dokku master
【问题讨论】:
-
您可以发布您的 Gemfile 内容吗?
-
@lacostenycoder 我添加了 gem 文件确保向下滚动
-
enter code heregroup是错字吗?你也真的需要git_sourcehackery block吗? -
抱歉,这是我在此处发布的类型,我进行了编辑。我不认为我需要 git_source。你认为问题出在这个@lacostenycoder
标签: ruby-on-rails ruby rubygems digital-ocean dokku