我已成功为安装设备启动此命令
rails generate devise:install
现在我必须启动
rails generate devise user
但是控制台告诉我:
/Users/hele/.rvm/gems/ruby-2.2.2/gems/activerecord-4.2.3/lib/active_record/connection_adapters/connection_specification.rb:177:in rescue in spec: Specified mysql2 for database adapter, but the gem is not loaded. Add gem 'mysql2' to your Gemfile (and ensure its version is at the minimum required by ActiveRecord). (Gem::LoadError)
在GemFile中我有:
source 'https://rubygems.org'
gem 'rails' , '4.2.3'
gem 'devise', '4.1.1'
gem 'mysql2'
gem 'bootstrap-sass', '~> 3.3.6'
gem 'font-awesome-rails', '4.3.0.0'
gem 'sqlite3'
gem 'sass-rails', '~> 5.0.4'
gem 'uglifier', '>= 1.3.0'
gem 'coffee-rails', '~> 4.0.0'
gem 'turbolinks'
gem 'jbuilder', '~> 1.2'
group :doc do
gem 'sdoc', require: false
end
有什么想法吗?
答案 0 :(得分:1)
对于Rails 4.2.3,试试:
gem 'mysql2', '~> 0.3.18'