Rails 4: Use MySql and MongoDB together - mysql

I'm trying to make an application in rails 4 using MongoDB(mongoid) and MySQL together.
But I'm not able to set it up.
I'm following the steps below:
rails new myapp -d mysql
Then added these lines to Gemfile:
gem "mongoid"
gem "bson_ext"
bundle install
rails g mongoid:config
The step 4 fails. I'm not able to figure out the problem. It shows the following error.
/home/devesh/.rvm/gems/ruby-2.2.2/gems/mongoid-1.0.6/lib/mongoid/associations.rb:5:in require': /home/devesh/.rvm/gems/ruby-2.2.2/gems/mongoid-1.0.6/lib/mongoid/associations/has_many.rb:79: syntax error, unexpected keyword_do_cond, expecting ':'
#documents = attributes ? attributes.collect do |attrs|
^
/home/devesh/.rvm/gems/ruby-2.2.2/gems/mongoid-1.0.6/lib/mongoid/associations/has_many.rb:84: syntax error, unexpected ':', expecting keyword_end
end : []
^
/home/devesh/.rvm/gems/ruby-2.2.2/gems/mongoid-1.0.6/lib/mongoid/associations/has_many.rb:99: syntax error, unexpected keyword_do_cond, expecting keyword_end
attributes.values.each do |attrs|
^
/home/devesh/.rvm/gems/ruby-2.2.2/gems/mongoid-1.0.6/lib/mongoid/associations/has_many.rb:139: syntax error, unexpected keyword_end, expecting end-of-input (SyntaxError)
from /home/devesh/.rvm/gems/ruby-2.2.2/gems/mongoid-1.0.6/lib/mongoid/associations.rb:5:in'
from /home/devesh/.rvm/gems/ruby-2.2.2/gems/mongoid-1.0.6/lib/mongoid.rb:40:in require'
from /home/devesh/.rvm/gems/ruby-2.2.2/gems/mongoid-1.0.6/lib/mongoid.rb:40:in'
from /home/devesh/.rvm/gems/ruby-2.2.2/gems/bundler-1.10.6/lib/bundler/runtime.rb:76:in require'
from /home/devesh/.rvm/gems/ruby-2.2.2/gems/bundler-1.10.6/lib/bundler/runtime.rb:76:inblock (2 levels) in require'
from /home/devesh/.rvm/gems/ruby-2.2.2/gems/bundler-1.10.6/lib/bundler/runtime.rb:72:in each'
from /home/devesh/.rvm/gems/ruby-2.2.2/gems/bundler-1.10.6/lib/bundler/runtime.rb:72:inblock in require'
from /home/devesh/.rvm/gems/ruby-2.2.2/gems/bundler-1.10.6/lib/bundler/runtime.rb:61:in each'
from /home/devesh/.rvm/gems/ruby-2.2.2/gems/bundler-1.10.6/lib/bundler/runtime.rb:61:inrequire'
from /home/devesh/.rvm/gems/ruby-2.2.2/gems/bundler-1.10.6/lib/bundler.rb:134:in require'
from /home/devesh/fashion_hub/store/config/application.rb:7:in'
from /home/devesh/.rvm/gems/ruby-2.2.2/gems/spring-1.3.6/lib/spring/application.rb:82:in require'
from /home/devesh/.rvm/gems/ruby-2.2.2/gems/spring-1.3.6/lib/spring/application.rb:82:inpreload'
from /home/devesh/.rvm/gems/ruby-2.2.2/gems/spring-1.3.6/lib/spring/application.rb:143:in serve'
from /home/devesh/.rvm/gems/ruby-2.2.2/gems/spring-1.3.6/lib/spring/application.rb:131:inblock in run'
from /home/devesh/.rvm/gems/ruby-2.2.2/gems/spring-1.3.6/lib/spring/application.rb:125:in loop'
from /home/devesh/.rvm/gems/ruby-2.2.2/gems/spring-1.3.6/lib/spring/application.rb:125:inrun'
from /home/devesh/.rvm/gems/ruby-2.2.2/gems/spring-1.3.6/lib/spring/application/boot.rb:18:in <top (required)>'
from /home/devesh/.rvm/rubies/ruby-2.2.2/lib/ruby/site_ruby/2.2.0/rubygems/core_ext/kernel_require.rb:54:inrequire'
from /home/devesh/.rvm/rubies/ruby-2.2.2/lib/ruby/site_ruby/2.2.0/rubygems/core_ext/kernel_require.rb:54:in `require'
I was following this url.
Some details:
OS - ubuntu 14.04
ruby v2.2.2
rails 4.2.3

add these line to your application.rb file:
config.generators do |g|
g.orm :active_record
end
This will force rails g to use active record.
And whenever you want to generate a model for mongodb, use:
rails g mongoid:model yourmodelname

Related

Install Gitlab CE in a GCP instance VM ubuntu 18.04

This is my first time trying to install Gitlab CE in a Google Cloud Platform instanceVM. I have followed two different ways to do that, the official one:
Ubuntu installation
and the one from this tutorial:
How to install gitlab.
However, in both cases I've got the same error:
bash
Running handlers:
There was an error running gitlab-ctl reconfigure:
bash[migrate gitlab-rails database] (gitlab::database_migrations line 55) had an error: Mixlib::ShellOut::ShellCommandFailed: Expected process to exit with [0], but received '1'
---- Begin output of "bash" "/tmp/chef-script20200523-23121-djcfhu" ----
STDOUT: rake aborted!
TZInfo::DataSourceNotFound: No source of timezone data could be found.
Please refer to https://tzinfo.github.io/datasourcenotfound for help resolving this error.
/opt/gitlab/embedded/service/gitlab-rails/config/application.rb:14:in `<top (required)>'
/opt/gitlab/embedded/service/gitlab-rails/Rakefile:5:in `require'
/opt/gitlab/embedded/service/gitlab-rails/Rakefile:5:in `<top (required)>'
/opt/gitlab/embedded/bin/bundle:23:in `load'
/opt/gitlab/embedded/bin/bundle:23:in `<main>'
Caused by:
TZInfo::ZoneinfoDirectoryNotFound: None of the paths included in TZInfo::ZoneinfoDataSource.search_path are valid zoneinfo directories.
/opt/gitlab/embedded/service/gitlab-rails/config/application.rb:14:in `<top (required)>'
/opt/gitlab/embedded/service/gitlab-rails/Rakefile:5:in `require'
/opt/gitlab/embedded/service/gitlab-rails/Rakefile:5:in `<top (required)>'
/opt/gitlab/embedded/bin/bundle:23:in `load'
/opt/gitlab/embedded/bin/bundle:23:in `<main>'
(See full trace by running task with --trace)
STDERR:
---- End output of "bash" "/tmp/chef-script20200523-23121-djcfhu" ----
Ran "bash" "/tmp/chef-script20200523-23121-djcfhu" returned 1
I have actually followed the link provided by the output Datasource not found but does talk about Ruby on Rails and I'm not using it. So, does anyone knows how to fix this ZoneInfo error in a GCP instance? Or how to let GitLab to ignore it.
Any kind of help will be useful :)
Thanks you all!
Btw, I'm using the bionic's gitlab-ce_13.0.0-ce.0_amd64.deb version
Ok, so i have just noticed that I was using the minimal version of Ubuntu Bionic. With the classical one gets fixed.

My IronWorker master slave setup results in a rest client 400 error. How do I solve this issue?

I am setting up a simple Ironworker Master/Slave worker,
but Iam consistently getting this error
/Users/Dan/.rvm/gems/ruby-1.9.3-head#healthberry/gems/rest-2.6.3/lib/rest/wrappers/typhoeus_wrapper.rb:66:in `handle_response': HTTP 400 Error. (Rest::HttpError)from /Users/Dan/.rvm/gems/ruby-1.9.3-head#healthberry/gems/rest-2.6.3/lib/rest/wrappers/typhoeus_wrapper.rb:74:in `post'
from /Users/Dan/.rvm/gems/ruby-1.9.3-head#healthberry/gems/rest-2.6.3/lib/rest/client.rb:195:in `block in post'
from /Users/Dan/.rvm/gems/ruby-1.9.3-head#healthberry/gems/rest-2.6.3/lib/rest/client.rb:142:in `perform_op'
from /Users/Dan/.rvm/gems/ruby-1.9.3-head#healthberry/gems/rest-2.6.3/lib/rest/client.rb:194:in `post'
from /Users/Dan/.rvm/gems/ruby-1.9.3-head#healthberry/gems/iron_core-1.0.1/lib/iron_core/client.rb:192:in `post'
from /Users/Dan/.rvm/gems/ruby-1.9.3-head#healthberry/gems/iron_worker_ng-1.0.4/lib/iron_worker_ng/api_client.rb:71:in `tasks_create'
from /Users/Dan/.rvm/gems/ruby-1.9.3-head#healthberry/gems/iron_worker_ng-1.0.4/lib/iron_worker_ng/client.rb:282:in `tasks_create'
from /Users/Dan/.rvm/gems/ruby-1.9.3-head#healthberry/gems/iron_worker_ng-1.0.4/lib/iron_worker_ng/client.rb:18:in `method_missing'
from /var/folders/lf/gbbgv7mn7_15znyc0m92x3nh0000gn/T/iron-worker-ng-20131209-65715-1wav70r-container/messages_dispatcher.rb:26:in `block in <top (required)>'
from /Users/Dan/.rvm/gems/ruby-1.9.3-head#healthberry/gems/activerecord-4.0.0/lib/active_record/relation/delegation.rb:13:in `each'
from /Users/Dan/.rvm/gems/ruby-1.9.3-head#healthberry/gems/activerecord-4.0.0/lib/active_record/relation/delegation.rb:13:in `each'
from /var/folders/lf/gbbgv7mn7_15znyc0m92x3nh0000gn/T/iron-worker-ng-20131209-65715-1wav70r-container/messages_dispatcher.rb:24:in `<top (required)>'
from __runner__.rb:213:in `require'
from __runner__.rb:213:in `<main>'
Here is the code that is producing this error:
Master:
*messages_dispatcher.rb*
require 'models/authentication
require 'iron_worker_ng'
require 'active_record'
require 'models/authentication'
require 'models/user'
ActiveRecord::Base.establish_connection('token and secret deleted')
client = IronWorkerNG::Client.new(:token => "token here", :project_id => "project id here")
#auth = Authentication.all
#auth.each do |a|
This line is producing the error
client.tasks.create("TweetMessagesWorker", user_id: a.user_id)
end
*messages_dispatcher.worker*
runtime "ruby"
gem "pg"
gem "activerecord"
exec "messages_dispatcher.rb"
# Merging models
dir '../app/models/'
full_remote_build true # Or remote
Slave:
*messages_worker.rb*
require 'iron_worker_ng'
puts params[:user_id]
# For simplicity I have omitted some code here
*messages_worker.worker*
runtime "ruby"
name 'TweetMessagesWorker'
exec 'messages_worker.rb'
full_remote_build true # Or remote
Has anyone had a similar issue.
I equally get an 400 error on the same line if I replace the 'rest' with the 'typheous' gem.
Any help is much appreciated!
Be sure you've uploaded your worker first with codes.create. 400 is usually caused by the code not existing on the server.
The ruby http clients hide the message that's returned right now, I'm going to look into the ruby stuff to ensure the message is displayed properly rather than just the error code.

What does this error mean as an output from the rails command?

from C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/bundler-1.0.22/lib/bundler/runtime.rb:68:in `block (2 levels) in
from C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/bundler-1.0.22/lib/bundler/runtime.rb:66:in `each'
from C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/bundler-1.0.22/lib/bundler/runtime.rb:66:in `block in require'
from C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/bundler-1.0.22/lib/bundler/runtime.rb:55:in `each'
from C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/bundler-1.0.22/lib/bundler/runtime.rb:55:in `require'
from C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/bundler-1.0.22/lib/bundler.rb:122:in `require'
from C:/RAILSI~1/INTERE~1/config/application.rb:7:in `<top (required)>'
from C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/railties-3.2.9/lib/rails/commands.rb:53:in `require'
from C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/railties-3.2.9/lib/rails/commands.rb:53:in `block in <top (required)>'
from C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/railties-3.2.9/lib/rails/commands.rb:50:in `tap'
from C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/railties-3.2.9/lib/rails/commands.rb:50:in `<top (required)>'
from script/rails:6:in `require'
from script/rails:6:in `<main>'
C:\RAILSI~1\INTERE~1\config>
This is all the output I could grab because DOS doesn't scroll up.
I am trying to port a rails app from Linux to windows. The only thing different is this app uses mysql. So In installed the MYSQL gem. Both using ruby 191, both using rails 329.
I have done some digging and it seams its because the mysql.dll I put in there is version 5.0 when the mysql gem was compiled for 6.0. Client 6.0 doesn't seem to exist.
I wouldn't normally ask but I am at my wit's end with this.
If you're using version 2.9.x of the MySQL gem, it was built against MySQL 6.0 and you can download the correct version of the C Connector from the MySQL web site. After installing the mysql gem, it should have given you a URL to go to to download the correct version. However, if you installed mysql using bundle install then the post-install message may not have been displayed.
http://dev.mysql.com/get/Downloads/Connector-C/mysql-connector-c-noinstall-6.0.2-win32.zip/from/http://cdn.mysql.com/
There's the URL to grab the binary library as a ZIP file.
http://dev.mysql.com/downloads/connector/c/
In case the first link doesn't work, there's the URL with all of the available C Connector downloads. You want Windows (x86, 32-bit), ZIP Archive (the second one; the one where the filename does not end in vs2005).
If the MySQL library still comes up as a mismatch, do a gem list mysql to get the version that is installed, then uninstall and reinstall the gem manually:
gem uninstall mysql
gem install -v=x.x.x mysql
Replace x.x.x with the version number that was reported previously. After the gem is installed, it should give you the URL of the C Connector you need to install.

RoR 3.0: rake db:create syntax error

* I'm going to learn Rails 3.1 better before I continue with this. Thanks for your help, everyone: I learned a lot! *
I'm trying to create an online portfolio based on Gullery, but I'm stuck at the very beginning: I can't create a database. When I run 'rake db:create', I get the following error:
rake aborted!
C:\Sites\gullery/RakeFile:14: syntax error, unexpected $end, expecting keyword_end
When I run a full trace, I get this:
C:\Sites\gullery>rake db:create --trace
rake aborted!
C:/Sites/gullery/Rakefile:14: syntax error, unexpected $end, expecting keyword_e
nd
C:/RailsInstaller/Ruby1.9.2/lib/ruby/gems/1.9.1/gems/rake-0.9.2.2/lib/rake/rake_
module.rb:25:in `load'
C:/RailsInstaller/Ruby1.9.2/lib/ruby/gems/1.9.1/gems/rake-0.9.2.2/lib/rake/rake_
module.rb:25:in `load_rakefile'
C:/RailsInstaller/Ruby1.9.2/lib/ruby/gems/1.9.1/gems/rake-0.9.2.2/lib/rake/appli
cation.rb:501:in `raw_load_rakefile'
C:/RailsInstaller/Ruby1.9.2/lib/ruby/gems/1.9.1/gems/rake-0.9.2.2/lib/rake/appli
cation.rb:82:in `block in load_rakefile'
C:/RailsInstaller/Ruby1.9.2/lib/ruby/gems/1.9.1/gems/rake-0.9.2.2/lib/rake/appli
cation.rb:133:in `standard_exception_handling'
C:/RailsInstaller/Ruby1.9.2/lib/ruby/gems/1.9.1/gems/rake-0.9.2.2/lib/rake/appli
cation.rb:81:in `load_rakefile'
C:/RailsInstaller/Ruby1.9.2/lib/ruby/gems/1.9.1/gems/rake-0.9.2.2/lib/rake/appli
cation.rb:65:in `block in run'
C:/RailsInstaller/Ruby1.9.2/lib/ruby/gems/1.9.1/gems/rake-0.9.2.2/lib/rake/appli
cation.rb:133:in `standard_exception_handling'
C:/RailsInstaller/Ruby1.9.2/lib/ruby/gems/1.9.1/gems/rake-0.9.2.2/lib/rake/appli
cation.rb:63:in `run'
C:/RailsInstaller/Ruby1.9.2/lib/ruby/gems/1.9.1/gems/rake-0.9.2.2/bin/rake:33:in
`'
C:/RailsInstaller/Ruby1.9.2/bin/rake:19:in `load'
C:/RailsInstaller/Ruby1.9.2/bin/rake:19:in `'
When I searched for "syntax error, unexpected $end, expecting keyword_end" on Google, the answers suggested that I missed an end somewhere. Unfortunately, I don't have the experience to know which file is missing one. Is that even the right problem? If so, where should I look? If not, what's actually going on?
I'm using Ruby on Rails 3.0, Ruby 1.9.2, and mySQL.
Thanks in advance!
EDIT: The contents of C:\Sites\gullery\Rakefile:
# Add your own tasks in files placed in lib/tasks ending in .rake,
# for example lib/tasks/switchtower.rake, and they will automatically be available to Rake.
require(File.join(File.dirname(__FILE__), 'config', 'boot'))
require 'rake'
require 'rake/testtask'
require 'rdoc/task'
RDoc::Task.new do |rdoc|
require 'tasks/rails'
# Fail if unit tests fail
task :default => [:test_units, :test_functional]
EDIT 2: Adding an "end" to the Rakefile eliminates the syntax error, but I the database still won't work.
The new Rakefile:
# Add your own tasks in files placed in lib/tasks ending in .rake,
# for example lib/tasks/switchtower.rake, and they will automatically be available to Rake.
require(File.join(File.dirname(__FILE__), 'config', 'boot'))
require 'rake'
require 'rake/testtask'
require 'rdoc/task'
RDoc::Task.new do |rdoc|
end
require 'tasks/rails'
# Fail if unit tests fail
task :default => [:test_units, :test_functional]
And the new error/trace:
C:\Sites\gullery>rake db:create --trace
WARNING: 'require 'rake/rdoctask'' is deprecated. Please use 'require 'rdoc/tas
k' (in RDoc 2.4.2+)' instead.
at C:/RailsInstaller/Ruby1.9.2/lib/ruby/gems/1.9.1/gems/rake-0.9.2.2/lib/rak
e/rdoctask.rb
C:/RailsInstaller/Ruby1.9.2/lib/ruby/1.9.1/rdoc/task.rb:30: warning: already ini
tialized constant Task
rake aborted!
Don't know how to build task 'db:create'
C:/RailsInstaller/Ruby1.9.2/lib/ruby/gems/1.9.1/gems/rake-0.9.2.2/lib/rake/task_
manager.rb:49:in `[]'
C:/RailsInstaller/Ruby1.9.2/lib/ruby/gems/1.9.1/gems/rake-0.9.2.2/lib/rake/appli
cation.rb:115:in `invoke_task'
C:/RailsInstaller/Ruby1.9.2/lib/ruby/gems/1.9.1/gems/rake-0.9.2.2/lib/rake/appli
cation.rb:94:in `block (2 levels) in top_level'
C:/RailsInstaller/Ruby1.9.2/lib/ruby/gems/1.9.1/gems/rake-0.9.2.2/lib/rake/appli
cation.rb:94:in `each'
C:/RailsInstaller/Ruby1.9.2/lib/ruby/gems/1.9.1/gems/rake-0.9.2.2/lib/rake/appli
cation.rb:94:in `block in top_level'
C:/RailsInstaller/Ruby1.9.2/lib/ruby/gems/1.9.1/gems/rake-0.9.2.2/lib/rake/appli
cation.rb:133:in `standard_exception_handling'
C:/RailsInstaller/Ruby1.9.2/lib/ruby/gems/1.9.1/gems/rake-0.9.2.2/lib/rake/appli
cation.rb:88:in `top_level'
C:/RailsInstaller/Ruby1.9.2/lib/ruby/gems/1.9.1/gems/rake-0.9.2.2/lib/rake/appli
cation.rb:66:in `block in run'
C:/RailsInstaller/Ruby1.9.2/lib/ruby/gems/1.9.1/gems/rake-0.9.2.2/lib/rake/appli
cation.rb:133:in `standard_exception_handling'
C:/RailsInstaller/Ruby1.9.2/lib/ruby/gems/1.9.1/gems/rake-0.9.2.2/lib/rake/appli
cation.rb:63:in `run'
C:/RailsInstaller/Ruby1.9.2/lib/ruby/gems/1.9.1/gems/rake-0.9.2.2/bin/rake:33:in
`'
C:/RailsInstaller/Ruby1.9.2/bin/rake:19:in `load'
C:/RailsInstaller/Ruby1.9.2/bin/rake:19:in `'
I'm running Rails 3.1 and my Rakefile looks like this:
#!/usr/bin/env rake
# Add your own tasks in files placed in lib/tasks ending in .rake,
# for example lib/tasks/capistrano.rake, and they will automatically be available to Rake.
require File.expand_path('../config/application', __FILE__)
V0100::Application.load_tasks
V0100 is my application name, corresponds to your "gullery".

Rails cannot generate model using mysql

Windows XP with installed MYSQL as a development machine, ruby 1.9.2p290 (2011-07-09) [i386-mingw32], Rails 3.1.0
gem install mysql2 -- '--with-mysql-lib="c:\Program Files\MySQL\MySQL S
erver 5.5\lib" --with-mysql-include="c:\Program Files\MySQL\MySQL Server 5.5\inc
lude"' (successfully installed gem mysql2)
rails new talk -d mysql (successfully created a new rails app called talk)
PROBLEM NOW STARTS:
C:\Sites\RP\talk>rails generate User
ERROR MESSAGE:
ruby.exe-Unable to Locate Component
This application has failed to start because libmysql.dll was not found. Re-installing the application may fix this problem.
COMMAND LINE ERROR MESSAGE:
C:/RailsInstaller/Ruby1.9.2/lib/ruby/gems/1.9.1/gems/mysql2-0.3.10/lib/mysql2.rb
:9:in require': 126: The specified module could not be found. - C:/RailsInsta
ller/Ruby1.9.2/lib/ruby/gems/1.9.1/gems/mysql2-0.3.10/lib/mysql2/mysql2.so (Load
Error)
from C:/RailsInstaller/Ruby1.9.2/lib/ruby/gems/1.9.1/gems/mysql2-0.3.10/
lib/mysql2.rb:9:in'
from C:/RailsInstaller/Ruby1.9.2/lib/ruby/gems/1.9.1/gems/bundler-1.0.18
/lib/bundler/runtime.rb:68:in require'
from C:/RailsInstaller/Ruby1.9.2/lib/ruby/gems/1.9.1/gems/bundler-1.0.18
/lib/bundler/runtime.rb:68:inblock (2 levels) in require'
from C:/RailsInstaller/Ruby1.9.2/lib/ruby/gems/1.9.1/gems/bundler-1.0.18
/lib/bundler/runtime.rb:66:in each'
from C:/RailsInstaller/Ruby1.9.2/lib/ruby/gems/1.9.1/gems/bundler-1.0.18
/lib/bundler/runtime.rb:66:inblock in require'
from C:/RailsInstaller/Ruby1.9.2/lib/ruby/gems/1.9.1/gems/bundler-1.0.18
/lib/bundler/runtime.rb:55:in each'
from C:/RailsInstaller/Ruby1.9.2/lib/ruby/gems/1.9.1/gems/bundler-1.0.18
/lib/bundler/runtime.rb:55:inrequire'
from C:/RailsInstaller/Ruby1.9.2/lib/ruby/gems/1.9.1/gems/bundler-1.0.18
/lib/bundler.rb:120:in require'
from C:/Sites/RP/talk/config/application.rb:9:in'
from C:/RailsInstaller/Ruby1.9.2/lib/ruby/gems/1.9.1/gems/railties-3.1.0
/lib/rails/commands.rb:21:in require'
from C:/RailsInstaller/Ruby1.9.2/lib/ruby/gems/1.9.1/gems/railties-3.1.0
/lib/rails/commands.rb:21:in'
from script/rails:6:in require'
from script/rails:6:in'
http://www.ruby-forum.com/topic/150580 has the answer. for some reason I need to:
1/ gem install mysql
2/ copy the libmysql.dll file from /MYSQL/MySQL Server 5.5/lib and paste it to Ruby1.9.2/bin
after that, it is smooth sailing...
Even though I did it, I would appreciate if anyone has an insight into the reason behind this:
On windows there should be a LIB environment variable. Have you checked to make sure that the path to libmysql has been added to this? I suspect it hasn't.