Ruby Build a Todo List Application with Rails 4 Build a Todo List Application with Rails 4 Generate a Rails Application

Treehouse VM versus install on my machine for ODOT and such

Just looking for some guidance here: I really like working alongside the videos as closely as a I can, so even though I've got Ruby, etc., all installed on my MacBook Pro, I'm likely going to be using the Treehouse VM to build ODOT.

However, I'm having a hard time wrapping my brain around where the code will live once I'm done. Will I be able to copy it to my own machine? Will I actually already have it? Should I just not use the VM?

With Workspaces and HTML, it's a moot point--easy copy and paste. But with this, less so. Thoughts? Opinions?

Thanks in advance! :grinning:

4 Answers

Mike Hickman
Mike Hickman
19,816 Points

Hi Jim,

I hope I'm understanding you correctly. The entire structure of ODOT lives locally on your machine if that's where you set it up. When you are starting your project you go to the folder you'd like your project to live, and then your "rails new ODOT" will create all the project files and folders for you in that location locally. If you already have ruby/rails installed, I'd say just do it all locally. I was able to follow along with the videos without any issues.

I have mine under C:\treehouse\projects\ODOT , so anytime I want to go back to the project and see/play with it, it's right there ready and available to me.

Just navigate to your ODOT project folder, start your local rails server after starting the project and your app is ready to interact with.

Another thing you could look into is pushing your ODOT project onto github so you know you'll have access to it wherever you are.

Hopefully this helped a bit. Have fun!

-Mike

Maciej Czuchnowski
Maciej Czuchnowski
36,426 Points

Like Mike said, if you use GitHub, you will always have access to your code. Even if you lose your project files from your computer for some reason.

The VM dedicated to this project will have everything installed in the proper versions and should work without hiccups, at least theoretically (I never tried their VM and Vagrant in general). I would probably just download the project files and look at the versions of gems in the gemfile.lock and make sure my project uses the exact same versions (especially Rails and RSpec gems). You might not be comfortable with doing that, so you can also download the project files from one of the first videos and use them as a starting point (before that make sure you understand what lead to the creation of the code you're looking at). This way you should have gemfile and gemfile.lock files in the project with the exact same versions as Jason uses in the videos, so when you run bundle install, the project should use the same stuff as in the videos from now on. That is the theory at least.

I'm just lucky you didn't say, "uh, just watch another minute of the video and all will become clear.": :wink:

I guess I don't quite understand what the VM is for if the files are locally stored. Is it just to level the playing field, and know that all students definitely have a development environment that works? In time perhaps that will become clear?

Maciej Czuchnowski
Maciej Czuchnowski
36,426 Points

Yeah, the idea was to give all students the same set of pre-installed tools in PROPER versions for the given course. There was a lot of chaos when people with Rails 4 tried to do the Treebook course. The new version of Rails and some other gems also make the code used in Odot course more and more outdated. I just don't get it why they decided to go with Vagrant instead a more hands-on emulator like VMWare Player that would give you a whole operating system with GUI inside a Window without typing some special commands in the console.

Andrew Stelmach
Andrew Stelmach
12,374 Points

So where should I go if I want to build my OWN Ruby app? Because trying to use this tutorial info to build my own app with 4.1.6 is leading to errors.

I would say two things:

  1. If you're new to this stuff, it makes sense to try and figure out a way to make this all work so that you can follow along and build this app through the course.

  2. If you just want to build your own thing, just go for it! Read the Ruby documentation and something like this and just have at!

My own learning path is that a)it helps me a ton to have the class to follow along with, and b)when I hit errors/trouble spots, I learn a lot about how to ask questions and fix things. This is what I'll have to do as a developer, so I'm okay with stalling out a bit while I work on something.