This is driving me farking insane.
I’m trying to create a simple beginner app utilizing ActiveRecord to do simple database tasks. I’m NOT using rails.
I keep getting the error:
RuntimeError: Please install the mysql adapter: `gem install activerecord-mysql-adapter` (Could not find mysql (~> 2.8.1) amongst [actionmailer-3.1.3, actionpack-3.1.3, activemodel-3.1.3, activerecord-3.1.3, activerecord-sqlserver-adapter-3.1.4, activeresource-3.1.3, activesupport-3.1.3, ansi-1.4.1, arel-2.2.1, bigdecimal-1.1.0, builder-3.0.0, bundler-1.0.21, capistrano-2.9.0, coffee-rails-3.1.1, coffee-script-2.2.0, coffee-script-source-1.1.3, daemons-1.1.4, erubis-2.7.0, eventmachine-0.12.10, execjs-1.2.9, highline-1.6.8, hike-1.2.1, hpricot-0.8.5, i18n-0.6.0, io-console-0.3, jquery-rails-1.0.19, json-1.6.3, mail-2.3.0, mime-types-1.17.2, minitest-2.5.1, multi_json-1.0.4, net-scp-1.0.4, net-sftp-2.0.5, net-ssh-2.2.1, net-ssh-gateway-1.1.0, nokogiri-1.5.0, polyglot-0.3.3, rack-1.3.5, rack-cache-1.1, rack-mount-0.8.3, rack-protection-1.1.4, rack-ssl-1.3.2, rack-test-0.6.1, rails-3.1.3, railties-3.1.3, rake-0.9.2.2, rdoc-3.11, rockhands-0.0.6, sass-3.1.11, sass-rails-3.1.5, shotgun-0.9, sinatra-1.3.1, sprockets-2.0.3, sqlite3-1.3.4, thin-1.3.1, thor-0.14.6, tilt-1.3.3, treetop-1.4.10, turn-0.8.3, tzinfo-0.3.31, uglifier-1.1.0])
This gem obviously doesn’t exist on rubygems, or this would be easy…
How else am I supposed to do this?
Heres the important part
ActiveRecord::Base.establish_connection(
:adapter => 'mysql',
:host => 'localhost',
:database => 'test',
:username => 'root',
:password => 'password'
)
I can see whatever I change :adapter to in the hash is what it inserts into the error ‘gem install activerecord-yousuck-adapter’
I’ve read just about every guide on google I can find…… at my wits end. I thought this would be at least a little easier…. I’ve spent hours and hours just fixing gem errors. Days in fact, and I have yet to write any actual ruby code. how frustrating.
Not sure if this is your problem but try using the
adapter: mysql2driver. It’s the recommended anyway since it’s way faster than the standardmysqlone.Do you still get the same issue?