Welcome to the Treehouse Community
Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.
Looking to learn something new?
Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.
Start your free trialgerald blady
9,052 Pointsrake db:create fails (can't seem to figure out based on other questions)
So when I run rake db:create it fails with the following error.
Could not find gem 'mysql2 (>= 0) ruby' in the gems available on this machine.
Run bundle install
to install missing gems.
I run bundle install to this error message:
An error occurred while installing mysql2 (0.3.17), and Bundler cannot continue.
Make sure that gem install mysql2 -v '0.3.17'
succeeds before bundling.
That fails as well.
Digging deeper I ran this in terminal.
mysql -bash: mysql: command not found
So I looked at other questions on this task to no avail.
I have mysql installed as i did it with the last ruby course prior to this one.
Any help would be greatly appreciated on the matter. Let me know other screenshots / info I need to provide to move past this matter.
please help!!!
gerald blady
9,052 PointsOS X 10.9.5
and thanks for the swift reply
Maciej Czuchnowski
36,441 PointsDo you have mysql instead of sqlite in your Gemfile? How does your config/database.yml file look like?
6 Answers
gerald blady
9,052 PointsJust did this, and it seemed to work, as i see this among other gems in terminal.
Installing mysql2 0.3.17
so then i did the rake db:create to which this happened.
Couldn't create database for {"adapter"=>"mysql2", "encoding"=>"utf8", "pool"=>5, "username"=>"root", "password"=>nil, "host"=>"localhost", "database"=>"biller_development"}, {:charset=>"utf8", :collation=>"utf8_unicode_ci"} (If you set the charset manually, make sure you have a matching collation) Couldn't create database for {"adapter"=>"mysql2", "encoding"=>"utf8", "pool"=>5, "username"=>"root", "password"=>nil, "host"=>"localhost", "database"=>"biller_test"}, {:charset=>"utf8", :collation=>"utf8_unicode_ci"} (If you set the charset manually, make sure you have a matching collation)
Jeff Jacobson-Swartfager
15,419 PointsIf you are using a ruby versioning system like rvm or rbenv, make sure that
-
You are using the right ruby
ruby -v
or (for rvm)
rvm list
or (for rbenv)
rbenv versions
-
You are using the right gemset
which gem
or (for rvm)
rvm gemset list
Since you are using bundler, you can also make sure you are using the right ruby and gemsets by declaring them in your Gemfile.
gerald blady
9,052 Pointsmysql -v ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2) Jerrys-MacBook-Pro:~ jerryblady$ mysql.server start Starting MySQL .... ERROR! The server quit without updating PID file (/usr/local/var/mysql/Jerrys-MacBook-Pro.local.pid
gerald blady
9,052 PointsCompletely removed MySQL via brew, reinstalled via brew, still, no luck
Blake Baxendell
16,344 PointsI am having the exact same issues, I removed, reinstalled. I also went through all the steps again. Hopefully some one at Treehouse can figure out this issue.
Blake Baxendell
16,344 PointsSeems that there is nothing solving this issue?
Jeff Jacobson-Swartfager
15,419 PointsI'm thinking it has something to do with rbenv, but I haven't had the chance on a rbenv machine (all of mine are running rvm).
Blake Baxendell
16,344 PointsI just moved on to another course. I may get back on this, hoping for an answer, but I will continue on with Ruby and just skip this lesson.
Jeff Jacobson-Swartfager
15,419 PointsGood luck!
Maciej Czuchnowski
36,441 PointsMaciej Czuchnowski
36,441 PointsHey Gerald, first tell me what operating system you're on.