ruby on rails - Please install mysql2 adapter -
i'm new of rails, , have big problem. i'm running rails 3.2.9 , ruby 1.9.3, did porting of rails app linux windows, in windows i'm having lot of problems mysql2 gem. installed mysql2 gem yesterday , tried run rake db:migrate have output:
rake aborted!
please install mysql2 adapter:gem install activerecord-mysql2-adapter
(cannot load such file -- mysql2)
c:/users/roccaa/desktop/project/config/environment.rb:5:in `'
tasks: top => db:migrate => environment
(see full trace running task --trace)
then gemfile
gem 'rails', '3.2.9' # bundle edge rails instead: # gem 'rails', :git => 'git://github.com/rails/rails.git' #gem 'sqlite3' # gems used assets , not required # in production environments default. group :assets gem 'sass-rails', '~> 3.2.3' # gem 'coffee-rails', '~> 3.2.1' # see https://github.com/sstephenson/execjs#readme more supported runtimes # gem 'therubyracer', :platforms => :ruby # gem 'uglifier', '>= 1.0.3' end gem 'coffee-rails', '~> 3.2.1' gem 'uglifier', '>= 1.0.3' gem 'jquery-rails' # use activemodel has_secure_password # gem 'bcrypt-ruby', '~> 3.0.0' # use jbuilder templates json # gem 'jbuilder' # use unicorn app server # gem 'unicorn' # deploy capistrano # gem 'capistrano' # use debugger # gem 'debugger' # gems needs auth gem 'cancan' gem 'devise' gem 'rolify' gem 'execjs' gem 'therubyracer', :platform => :ruby gem 'populator' gem 'faker' gem 'paperclip' gem 'simple_xlsx_writer' gem 'roo' gem 'mysql2', '0.3.11' gem 'simple_xlsx_writer' gem 'rake', '~> 10.0.4' gem 'icalendar'
and database.yml
development: adapter: mysql2 encoding: utf8 reconnect: false database: emc pool: 5 username: root password: root socket: /var/run/mysqld/mysqld.sock testing: adapter: mysql2 encoding: utf8 reconnect: false database: emc pool: 5 username: root password: root socket: /var/run/mysqld/mysqld.sock production: adapter: mysql2 encoding: utf8 reconnect: false database: emc pool: 5 username: root password: root socket: /var/run/mysqld/mysqld.sock
i tried solve problem in lots of ways, read have use mysql2 version < 0.3 version have output
warning: version of mysql2 (0.2.18) isn't compatible rails 3.1 activerecord adapter pulled rails itself.
warning: please use 0.3.x (or greater) releases if plan on using in rails >= 3.1.x
rake aborted!
undefined method `accept' nil:nilclass
tasks: top => db:migrate
(see full trace running task --trace)**
hope can me, thanks.
try gemfile
instead of using:
gem 'mysql2', '0.3.11'
use this:
gem 'mysql2'
this working me.
and way have duplicate gem
gem 'simple_xlsx_writer'
Comments
Post a Comment