Welcome to the Treehouse Community

The Treehouse Community is a meeting place for developers, designers, and programmers of all backgrounds and skill levels to get support. Collaborate here on code errors or bugs that you need feedback on, or asking for an extra set of eyes on your latest project. Join thousands of Treehouse students and alumni in the community today. (Note: Only Treehouse students can comment or ask questions, but non-students are welcome to browse our conversations.)

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and a supportive community. Start your free trial today.

Ruby ActiveRecord Basics Migrations and Relationships Migrations

John Simoneau
PLUS
John Simoneau
Courses Plus Student 8,105 Points

No biller or biller_development databases

Having issues that I can't seem to resolve with any of the answers I found here or Google.

First off, I don't recall seeing any errors when creating the database. If I try to create it again just to be sure I just get a bunch of errors but I don't think those errors existed initially and if I search my OS X system for biller_development then it leads me to a database.yml file that is in the project and contains biller_development wording etc. So I assume the database is created ok.

When I tried to run the mysql -uroot command it gave me a command not found error. Searching around the site I found a recommendation to use this code

/usr/local/mysql/bin/mysql -uroot

Which gets that running for me. Only problem is it doesn't show the biller databases. Instead, it only shows the ones I created during the intro to mysql part of the Rails track earlier and I'm pretty sure those might not be stored in the same location as this new project db. So, I thought maybe because the server is still running on the MySQL workbench from the last workshop (he never instructed to shut it down) that maybe it's causing a conflict and my console is seeing that rather then what I'm trying to work on. Only problem with that is it refuses to shut down. It shuts down but then says it's missing the PID file and auto restarts it looks like. I'm not even sure if shutting this down or not will have any effect but just trying to state what I've tried and what's going on.

Any advise so I can continue with the course? Thanks!

3 Answers

My post is here - have a work through that and see if that fixes it.

Else, there's an awful lot of variables to play with - I messed about with this for quite some time. Let me know if you're getting nowhere - I will try to help!

Steve.

John Simoneau
John Simoneau
Courses Plus Student 8,105 Points

Actually, I think I already came across your post there when trying to find an answer before posting. Think I was afraid/overwhelmed to try some of it but I'll go through it again and see if I have more courage this time since it doesn't appear I'm going to find too many easier routes....LOL. Re-installing anything just sounds overwhelming to me but maybe it's not so bad.

John Simoneau
John Simoneau
Courses Plus Student 8,105 Points

Ok, so.... kinda confusing. I'm not 100% sure what fixed it but I'll say the steps I think I did.

1st - I checked to be sure I had homebrew installed (which I did) because I knew part of the instructions were going to be using that.

https://gorails.com/setup/osx/10.10-yosemite

2nd - Before trying to figure out how to re-install rails I decided to just use those same instructions to reinstall MySQL since it was the problem in the first place. Once I did that (by simply using the install code again... not sure if I should have but did) then the mysql -uroot command started working BUT the desired database still wasn't listed.

WHERE I MESSED UP HERE WAS BY NOT TRYING TO CREATE THE DATABASE AGAIN LIKE YOU DID AFTER THE RAILS RE-INSTALL. Otherwise, this MIGHT have been all that was necessary.

3rd - I reinstalled rails by running the same install rails command mentioned in the above link. I'm not sure it actually did anything though other then add the documentation?

Still, no database I need.

4th - Did the same thing again installing rails again over itself (since I couldn't find un-install instructions) but this time it appeared to do a little more. I also rehashed it.

5th - Checked and the DB still wasn't there.

6th - Decided to try and create the database again which appeared to fully create it again.

7th - Checked and FINALLY it was there :)

In conclusion... if the mysql -uroot command doesn't work then I'd try re-installing the MySQL like I did (in my case via home-brew) which appears to fix it.

If you're having problems with the missing database then I'd start with re-installing the MySQL THEN be sure to create the database needed again and verifying before going through all the steps with Rails installations. Just incase because I'm thinking that alone might have fixed it.

John Simoneau
John Simoneau
Courses Plus Student 8,105 Points

Thank you Steve Hunter for putting yourself out there to help. Much appreciated :)

I think the main thing I took from my huge struggles with this course is to just get stuck in, Google stuff, try stuff out, ask dumb questions.

I had the same issue as you did and then I had this one that took me weeks to sort out.

As a result, I am now way more onfident messing about with databases & Rails than I would be otherwise. Indeed, I wrote a blog post yesterday about an issue I managed to fix without shouting for help far and wide! That's a first!!

So, my advice is to mess about with any possible solutions Google sends your way - you'll gain loads from it and learn who's actually in charge. (It's the laptop)

If I can help at all, just shout on here or catch me on Twitter.

Best of luck!

Steve.

John Simoneau
John Simoneau
Courses Plus Student 8,105 Points

Ouch! Yeah... I'm stuck right now trying to figure out how the heck I'm supposed to proceed with the course since there was no instructions provided at that point (I have a new thread on it). I don't want to mess things up and then ask for help because I'm in a hurry to learn rails. I obviously learn a lot from googling things but I also get confused by it too which backtracks me even further.

Yes, the laptop does seem to be in-charge...LOL. That's unfortunate given how old and messed up my MBP is. I didn't realize my OS X console etc would ever be touched in web development. This is a whole new world but it's less daunting the more I learn and get comfortable with it.

I added you to my Twitter account a couple days ago. I haven't been on there much in a while but looks like that's where a lot of developers are, tips, support, etc so think I'll be digging in again.

Thanks!

I wrote a post about this a couple of months ago 'cos I was getting nowhere with this too! I'll try and dig it out.

Keep the faith - we can get this sorted! I'm just about to eat dinner; I'll be back after that.

As a 'throw it out there' try running mysqld in a separate terminal/console. Might work.

Steve.

John Simoneau
John Simoneau
Courses Plus Student 8,105 Points

Sorry, had to leave right after I posted this and just got back. I tried running the mysqld a second ago and it didn't work but moving onto your next post below to try that stuff out. Thank you for the help!