Rails错误:“无法在此机器上可用的宝石中找到gem'activerecord-mysql2-adapter(> = 0)ruby'

时间:2012-04-29 20:43:49

标签: ruby ruby-on-rails-3

我做了gem mysql2。这就是我的GemFile的样子:

source 'https://rubygems.org'

gem 'rails', '3.2.3'

# Bundle edge Rails instead:
# gem 'rails', :git => 'git://github.com/rails/rails.git'

gem 'sqlite3'


# Gems used only for assets and not required
# in production environments by default.
group :assets do
  gem 'sass-rails',   '~> 3.2.3'
  gem 'coffee-rails', '~> 3.2.1'
gem 'mysql2' 
  # See https://github.com/sstephenson/execjs#readme for more supported runtimes
  gem 'therubyracer', :platform => :ruby
gem 'activerecord-mysql2-adapter'
  gem 'uglifier', '>= 1.0.3'

end

gem 'jquery-rails'

# To use ActiveModel has_secure_password
# gem 'bcrypt-ruby', '~> 3.0.0'

# To use Jbuilder templates for JSON
# gem 'jbuilder'

# Use unicorn as the app server
# gem 'unicorn'

# Deploy with Capistrano
# gem 'capistrano'

# To use debugger
# gem 'ruby-debug19', :require => 'ruby-debug'

这是我的配置文件:

development:
  adapter: mysql2
  encoding: utf8
  database: qac_db
  pool: 5
  username: root
  password:
  socket: /tmp/mysql.sock

我哪里错了?

2 个答案:

答案 0 :(得分:0)

删除第gem 'activerecord-mysql2-adapter'行。然后运行bundle install

答案 1 :(得分:0)

为了它的价值,我删除了我的database.yml,并重新创建它,然后一切都开始工作了。不知道为什么,权限问题也许?