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 trial

Ruby ActiveRecord Basics Migrations and Relationships Looking at our Application

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

Before I mess anything up... How to proceed?

Hampton Catlin was so awesome up until this point :p I was getting more confident with Rails and now I feel like a dog wearing roller skates...lol.

Ok, so I've tried reading through all other posts here to formulate a strategy but they all seemed to start from a messed up point. I'm at a fresh start point so I'd like to do this smoothly and correct the first way before I need help fixing it. KWIM?

So I've downloaded the files. I've read one suggestion to treat it as a new project rather then replacing my existing one so I began proceeding with that. I renamed the folder to biller-new and put it in my home folder. I fired up MySQL in the console and connected the developer biller database too it. Then I thought I'd take a glance at the local host 3000 too see if it did anything but when I tried to start the rails server I got this error

Could not find rake-10.1.1 in any of the sources
Run `bundle install` to install missing gems.

I know the message says to do a bundle install but I was worried about doing that as it didn't make sense. I thought that maybe I needed to do some raking but I'm afraid that will mess-up the project.

It seems to make more sense to me to replace my project files with these updated ones and then do a rake to update things but it looks like that's the wrong way to go?

In the other posts it looks like others found a way to import some of the bogus database accounts etc he setup so if possible I'd like to get that going too. Does anyone have any clear instructions on how to proceed here? I can do it with my existing project or this biller-new I setup.

Thanks and hopefully Hampton or someone will add instructions for this to the teachers notes for others in the future. It's a lot of wasted hours trying to figure out what to do. I'd rather be learning :)

Matt Young
Matt Young
6,348 Points

I'd like some clear instructions on how to update my project too.

John Simoneau
John Simoneau
Courses Plus Student 8,105 Points

Matt Young I'm not recommending it BUT you could check out how I did it below. Just don't shoot me if things go haywire...

1 Answer

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

Ok, I'm impatient. Apparently there's nobody sitting around on their Sunday just waiting to help me at every whim...LOL.

So, I have NO IDEA if this is how anyone would recommend this way to proceed. I don't know if it will haunt me later and there will be some form of odd-ball error. It's just the way things made sense to me without harming any work I've already done so I went with it.

  1. Downloaded the updated project files. Renamed them to "biller-new" and moved them to my home folder where the other "biller" project is.

  2. Opened up the MySQL Workbench that we just learned about on the track. I created a new schema named "biller_two_development" and another new schema named "biller_two_test".

  3. I exported my "biller_development" self contained file into the default dump folder. I then exported my "biller_test" just the same.

  4. I opened the "biller_development" export file that was saved to my dump folder in Sublime text editor and did a find/replace for "biller_development" to "biller_two_development" and saved (think it finds 3 things). Then I opened the "biller_test" export file (remember these are named something else with a date stamp as part of the name) and did a find/replace for "biller_test" to "biller_two_test" and saved.

  5. I did a MySQL Workbench import of a self contained file using the "biller_development" export we had been working on and imported it into the "biller_two_development" schema (UTF 8 Default). I did the same for the "biller_test" file.

  6. I navigated to "biller-new" in the terminal

  7. Opened the "biller-new" in Sublime (I dragged and dropped the folder).

  8. I ran a Find in Files for "biller_development" and it pulls up two things. The database.yml and a dump file. Inside those two files I did a find/replace for "biller_development" to "biller_two_development". Did the same again for the "biller_test" to "biller_two_test". Saved.

  9. In the terminal I ran mysql -uroot. Followed by show databases;. Followed by use biller_two_development assuming it's displayed now. Then exit if that is successful.

  10. In the terminal attempt to fire up Rails Server via rails s. Assuming that errors then run the bundle install command it recommends.

  11. Once successful then fire it up again with rails s. Glance at your localhost 3000 page and be sure the /accounts/ page or any other urls you used before work again and display something.

  12. In the terminal control c to exit the server.

  13. Then to get the other database entries Hampton added you'll run mysql -uroot. use biller_two_development; which might not be needed but doesn't hurt. Then if on a mac and don't forget to change to your username in the path or make any adjustments source /users/YOURUSERNAME/biller-new/dump.sql;. Then type exit once complete.

  14. Run rails s again and follow along with the "Looking at our Application" video to test things out. Everything worked perfect for me at that point but I HAVEN'T dug into the next set of videos yet to know if I messed anything up so do it at your own risk!

John Simoneau
John Simoneau
Courses Plus Student 8,105 Points

In hind sight I imagine just replacing the biller folder with the download and running the install command recommended in my original post might have worked. But, I just wasn't wanting to take any risk with the database files since I'm just learning and not sure how to fix issues etc. So this seemed safe and MOST of the steps above are just duplicating the database files and renaming things so they will work as a separate copy of everything.

Should I reward myself Best Answer?...LOL. I'm sure there are better and easier ways but I'm pretty happy I accomplished this myself. At least it seems that way...