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

Eddie Flores
Eddie Flores
9,110 Points

Unofficial Guide to ACTUALLY finishing the RoR Intro Tutorial

Background:

I'm not sure how many people over the past 2 months have seen my constant questions on things related to the intro tutorial. In my quest, I was heavily determined and hellbent on learning this tutorial and finishing it.

I've learned a few little tricks in order to ACTUALLY finishing this tutorial without errors plaguing each step.

One thing that they didn't explain is that the Ruby and Rails version that you use is vital, and depending on whether you are doing this on a PC, Mac or Linux machine. I've found a way that you can get around this by a cloud IDE (uses Linux). There are several places that you can go to. CodeEnvy, Cloud9, and Nitrous.io

I personally went through Nitrous.io because I found it to be the easiest way to set it up, and provided the best personalized Linux box than the other 2 that I mentioned above. It saves your information in the cloud and it also has a google chrome app, so it's easily accessible. If you wish to sign up, feel free to use the link provided. I would personally appreciate the referral.

[https://www.nitrous.io/join/ySUJiJioAYw]

Okay with the formalities out of the way. Here we go.

Requirements:

The tutorial doesn't say or specify what is recommended to know by the time you dive into this tutorial. I will suggest that you do a basic Ruby course on Code Academy AND a basic rails coding course. There are several Youtube channels that are very good at explaining the basics.

If you have no programming understanding, I would suggest HIGHLY to go through the Introduction to Programming mini-course [http://teamtreehouse.com/library/programming/introduction-to-programming]. It's easy, informative, and creates a decent foundation to your future learning experience. If you are experienced with any other type of programming language (HTML/CSS is not considered a "true" programming language) learning RoR should be a bit easy to follow with.

Setting up a Nitrous Box:

Go to nitrous.io and sign up. You can set up a new box by clicking on "Boxes" link at the top and then "New Box". You can adjust the settings you want, and as you get more N2O, you can upgrade your box. Select your region and what application you are using it for. In this case, Ruby. In 30-45 seconds you have created your first Ruby box.

Installing RVM:

With a Nitrous Box set up I will install RVM (Ruby Version Manager) first. Nitrous has the newest Ruby and Rails versions automatically installed, so we will have to break that up. You can go to [https://rvm.io/] and see all of the options, but for the sake of this semi-tutorial we will use the code below.

In the terminal area, enter the workspace folder using "cd workspace" and then type:

curl -L https://get.rvm.io | bash -s stable --ruby=1.9.3

This will install RVM using 1.9.3. I'm not sure if you notice that in video 7 (Generating a Rails Application) in the Getting Started with Rails video you notice that Jason uses RVM. Now, any time that you use Nitrous your first command should be "rvm use 1.9.3"

Using RVM:

Once installed, you will need to install the proper version of Rails. Without it, this tutorial will be hell.

So you will have to type this in:

rvm use <ruby version>
rvm gemset create rails3.2.12
rvm <ruby version>@rails3.2.12
gem install rails --version=3.2.12

Once with this... you are good to go and just follow the rest of the videos line for line. Minor deviations will and can screw things up.

Trip Up Tips:

When installing devise [Video 2, Installing Devise, Creating an Authentication System], use:

Use Devise for authentication system
gem 'devise', '3.0.0rc'

In the video for Fixtures [Video 4, Fixtures, Writing Tests] there is a small issue written in the notes, but not said in the video. In the users.yml file delete:

password: "password"
password_confirmation: "password"

This can cause issues where it makes failures appear that you cannot get rid of.

When writing up the users.yml file make sure that your indentation is precise. I ran through some issues where I was wondering why my code was failing despite being exactly like it was on the video. The indentation was off, and that made everything wrong.

This was my original code:
jason:
first_name: "Jason"
last_name: "Seifer"
email: "jason@teamtreehouse.com"
profile_name: "jasonseifer"

This is my code after:
jason:
  first_name: "Jason"
  last_name: "Seifer"
  email: "jason@teamtreehouse.com"
  profile_name: "jasonseifer"

I really hope that everyone and anyone that reads this takes something away from it, and can successfully learn what you want out of this tutorial.

2 Answers

James Barnett
James Barnett
39,199 Points

Thanks for putting this together, it looks really helpful.

Great Job !