rake:db using mysql3

38 views
Skip to first unread message

Mohammed Rashid

unread,
Sep 3, 2014, 9:34:07 AM9/3/14
to rubyonra...@googlegroups.com
Hi, I have created a new app using "rails new biller -d mysql" command
and when I run "rake db:create", it shows me an error saying "Could not
find gem 'mysql2 (>=0) x86-mingw32' in the gems available on this
machine."

I have also noticed that I cannot run "rails s" also as it shows the
same error. I tried correcting this with:

"bundle install"
and
"gem install mysql2"

however, gem install "mysql3" works. If so then why doesn't "rake
db:create" work. I Is there a way to make the same command for mysql3
becasue it says I have installed it.

My possible solutions:
Could this be that I deleted and downloaded a software I thought was
Workbench but it was actually mysql2? all over again not knowing I have
downloaded the wrong one?..
I installed "mysql-installer-web-community-5.6.20.0" which may be the
problem, but I dont know how to get mysql2 back. Im trying my hardest to
diagnose the problem can somebody please help me. Everything was fine
last night now I can't even run "rails s". I know i'm very close. PLEASE
HELP !:P

--
Posted via http://www.ruby-forum.com/.

Jason Fleetwood-Boldt

unread,
Sep 3, 2014, 10:55:24 AM9/3/14
to rubyonra...@googlegroups.com


The "2" or "3" after the gem refers to the version of the mysql rails adapter (the gem), not the version of MySQL

What does your Gemfile actually say ? 

also it might be that you're on Windows, in which case you may have special considerations building & compiling that Gem and/or MySQL (beyond my expertise, but you might want to look for a set of instructions on the internet specifically for setting up Rails+MySQL on windows)
-- 
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-ta...@googlegroups.com.
To post to this group, send email to rubyonra...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/432b363396236e4c69ce5b50c202c6b8%40ruby-forum.com.
For more options, visit https://groups.google.com/d/optout.


Mohammed Rashid

unread,
Sep 3, 2014, 12:10:30 PM9/3/14
to rubyonra...@googlegroups.com
I have sorted the problem now Jason thanks for your help. You are right
I changed syntax from the Gemfile and database.ylm class from sqlite2 to
sqlite 3 and the files are created.

Now im typing "mysql u-root" and it does not work. Can you tell me how
to run "u -root" using windows which will take me to the MySQL monitor
in the command prompt. The guy in the tutorial uses mac and when I do it
"mysql" command is not recognized by windows.

Hassan Schroeder

unread,
Sep 3, 2014, 12:38:20 PM9/3/14
to rubyonrails-talk
On Wed, Sep 3, 2014 at 9:09 AM, Mohammed Rashid <li...@ruby-forum.com> wrote:
> I have sorted the problem now Jason thanks for your help. You are right
> I changed syntax from the Gemfile and database.ylm class from sqlite2 to
> sqlite 3 and the files are created.
>
> Now im typing "mysql u-root" and it does not work.

Uh, well. Why do you care about that if you're not using MySQL? Or
if you *do* want to use MySQL why are you specifying sqlite3 in your
database config?

They are two entirely different database engines.

Also, the command would be "mysql -u root" but first figure out what
database you're actually trying to use.

--
Hassan Schroeder ------------------------ hassan.s...@gmail.com
http://about.me/hassanschroeder
twitter: @hassan

Jason Fleetwood-Boldt

unread,
Sep 3, 2014, 1:22:46 PM9/3/14
to rubyonra...@googlegroups.com

Yea sorry I'm not really familiar with MySQL on Windows. Probably a good idea to get really solid with that first (maybe there's a beginner tutorial for?), can't help you there.

Mohammed Rashid

unread,
Sep 3, 2014, 9:40:12 PM9/3/14
to rubyonra...@googlegroups.com
Thanks a lot Jason you've helped as much as you could. And Hassan, I am
wanting to use MySQL instead of sqlite3 now. I have MySQL community
server installed. I cannot seem to install the gem I'm having problems
as it cannot recognise when I run gem install mysql2. however when I
download a version from the internet and specify that file by saying
(and I'm making numbers up here) "gem install v-4.1.2" it installs that
gem but in a binary version. It still however does not create rake
db:create ?

Hassan Schroeder

unread,
Sep 3, 2014, 11:57:16 PM9/3/14
to rubyonrails-talk
On Wed, Sep 3, 2014 at 6:39 PM, Mohammed Rashid <li...@ruby-forum.com> wrote:

> ... wanting to use MySQL instead of sqlite3 now.

OK, great. Now, it sounds like your development environment isn't
really set up properly, but that's somewhat OS-specific and I have
no idea what to do with a Windows system at this point.

Hopefully someone can help with that.

Best of luck!

Mohammed Rashid

unread,
Sep 8, 2014, 8:29:05 AM9/8/14
to rubyonra...@googlegroups.com
Again, thank you for the great advice Hassan. I'm starting to get a
little comfortable with using mysql2, I fixed it with using a different
way of installing using Cmd now and have fixed all installation
problems.
Reply all
Reply to author
Forward
0 new messages