{"id":6873,"date":"2014-05-08T00:27:04","date_gmt":"2014-05-08T00:27:04","guid":{"rendered":"https:\/\/unknownerror.org\/index.php\/2014\/05\/08\/please-install-mysql2-adapter-collection-of-common-programming-errors\/"},"modified":"2014-05-08T00:27:04","modified_gmt":"2014-05-08T00:27:04","slug":"please-install-mysql2-adapter-collection-of-common-programming-errors","status":"publish","type":"post","link":"https:\/\/unknownerror.org\/index.php\/2014\/05\/08\/please-install-mysql2-adapter-collection-of-common-programming-errors\/","title":{"rendered":"Please install mysql2 adapter-Collection of common programming errors"},"content":{"rendered":"<p>I&#8217;m new of rails, and i have this big problem. I&#8217;m running rails 3.2.9 and Ruby 1.9.3, I did a porting of a rails app from linux to windows, but in windows i&#8217;m having a lot of problems with mysql2 gem. I installed mysql2 gem yesterday and than i tried to run rake db:migrate but i have this output:<\/p>\n<blockquote>\n<p>rake aborted!<br \/>\nPlease install the mysql2 adapter: <code>gem install activerecord-mysql2-adapter<\/code> (cannot load such file &#8212; mysql2) C:\/Users\/RoccaA\/Desktop\/project\/config\/environment.rb:5:in `&#8217; Tasks: TOP =&gt; db:migrate =&gt; environment<\/p>\n<p>(See full trace by running task with &#8211;trace)<\/p>\n<\/blockquote>\n<p>Then this is my Gemfile<\/p>\n<pre><code>gem 'rails', '3.2.9'\n# Bundle edge Rails instead:\n# gem 'rails', :git =&gt; 'git:\/\/github.com\/rails\/rails.git'\n#gem 'sqlite3'\n# Gems used only for assets and not required\n# in production environments by default.\ngroup :assets do\n  gem 'sass-rails',   '~&gt; 3.2.3'\n#  gem 'coffee-rails', '~&gt; 3.2.1'\n  # See https:\/\/github.com\/sstephenson\/execjs#readme for more supported runtimes\n  # gem 'therubyracer', :platforms =&gt; :ruby\n # gem 'uglifier', '&gt;= 1.0.3'\nend\n gem 'coffee-rails', '~&gt; 3.2.1'\n gem 'uglifier', '&gt;= 1.0.3'\ngem 'jquery-rails'\n# To use ActiveModel has_secure_password\n# gem 'bcrypt-ruby', '~&gt; 3.0.0'\n# To use Jbuilder templates for JSON\n# gem 'jbuilder'\n# Use unicorn as the app server\n# gem 'unicorn'\n# Deploy with Capistrano\n# gem 'capistrano'\n# To use debugger\n# gem 'debugger'\n# this gems needs for auth\ngem 'cancan'\ngem 'devise'\ngem 'rolify'\ngem 'execjs'\ngem 'therubyracer', :platform =&gt; :ruby\ngem 'populator'\ngem 'faker'\ngem 'paperclip'\ngem 'simple_xlsx_writer'\ngem 'roo'\ngem 'mysql2', '0.3.11'\ngem 'simple_xlsx_writer'\ngem 'rake', '~&gt; 10.0.4'\ngem 'icalendar'\n<\/code><\/pre>\n<p>And this is my database.yml<\/p>\n<pre><code>development:\n\n  adapter: mysql2\n  encoding: utf8\n  reconnect: false\n  database: emc\n  pool: 5\n  username: root\n  password: root\n  socket: \/var\/run\/mysqld\/mysqld.sock\ntesting:\n\n  adapter: mysql2\n  encoding: utf8\n  reconnect: false\n  database: emc\n  pool: 5\n  username: root\n  password: root\n  socket: \/var\/run\/mysqld\/mysqld.sock\nproduction:\n\n  adapter: mysql2\n  encoding: utf8\n  reconnect: false\n  database: emc\n  pool: 5\n  username: root\n  password: root\n  socket: \/var\/run\/mysqld\/mysqld.sock\n<\/code><\/pre>\n<p>I tried to solve this problem in a lots of ways, i read that i have to use mysql2 version &lt; 0.3 but with this version I have this output<\/p>\n<blockquote>\n<p>WARNING: This version of mysql2 (0.2.18) isn&#8217;t compatible with Rails 3.1 as the ActiveRecord adapter was pulled into Rails itself. WARNING: Please use the 0.3.x (or greater) releases if you plan on using it in Rails &gt;= 3.1.x rake aborted! undefined method `accept&#8217; for nil:NilClass Tasks: TOP =&gt; db:migrate<\/p>\n<p>(See full trace by running task with &#8211;trace)**<\/p>\n<\/blockquote>\n<p>Hope someone can help me, thanks.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>I&#8217;m new of rails, and i have this big problem. I&#8217;m running rails 3.2.9 and Ruby 1.9.3, I did a porting of a rails app from linux to windows, but in windows i&#8217;m having a lot of problems with mysql2 gem. I installed mysql2 gem yesterday and than i tried to run rake db:migrate but [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-6873","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"_links":{"self":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts\/6873","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/comments?post=6873"}],"version-history":[{"count":0,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts\/6873\/revisions"}],"wp:attachment":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/media?parent=6873"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/categories?post=6873"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/tags?post=6873"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}