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 Build a Simple Ruby on Rails Application Customizing Forms Creating Relationships

Pierre Poujade
Pierre Poujade
7,085 Points

The course should really be updated

It is very interesting but unfortunately things taught in the Rails courses are broken.

It was made for Rails 3.2 and we are now at Rails 4, simple_form in its latest version isn't compatible with the latest Bootstrap 3 (only with 2.3) and it seems the way attr_accessible is handled by Rails 4 changed a lot as well.

That makes the whole thing irrelevant.

I appreciate things move fast in the software world but being unable to reproduce the things showed in the video and knowing that one will have to relearn anyway when working on a real project is kind of frustrating.

I hope this is constructive and that an updated course will eventually come up!

18 Answers

John Steer-Fowler
PLUS
John Steer-Fowler
Courses Plus Student 11,734 Points

Hi Pierre,

I agree, most of the Rails Track is outdated now as we are on Rails 4. I managed to get through the Track using rails 4 and googling a lot of stuff.. so I agree that it needs to be updated. I guess it takes the Treehouse staff a while to update things, so I guess we will have to be patient :P

Have you seen the Rails tutorial that Jason made using Rails 4? I have been working through it this week, it seems quite good. Instead of the original Social Network, we are now making a ToDo List app.

Pierre Poujade
Pierre Poujade
7,085 Points

No, I didn't. But I'm intrigued, where is that?

Jared Galanis
Jared Galanis
8,382 Points

So what I think would be helpful is at least a warning early on in the project videos or on the project page that if particular versions aren't used then some problem solving that is outside the scope of the tutorial is going to be involved. I agree with Rodrigo that sometimes you can get a lot out of working through the solutions to these unexpected problems, but it would be nice to be educated about the issues up front so that we can make a choice. Maybe we were warned and I missed that, but I got as far as Pierre did before I realized there going to be some major issues with using the most current versions of Rails and Bootstrap. Now that I am aware of this type of issue, I will follow James' thinking. It's just not necessarily something that will occur to every beginner developer.

John Steer-Fowler
PLUS
John Steer-Fowler
Courses Plus Student 11,734 Points

I think that the problem here, is that if you are a beginner to Ruby on Rails, it is complicated and confusing enough to learn it without having to think about different versions, what is accepted anymore and what does and doesn't need to be done anymore.

Experts of Ruby on Rails might find it easy to understand the updates and conventions of Rails, but from personal experience I got extremely confused when new versions of Rails were released while trying to learn the framework.

I would say this is the gist of this thread.

James Barnett
James Barnett
39,199 Points

> it is complicated and confusing enough to learn it without having to think about different versions

I agree, don't worry about any different versions.


  1. Find the learning material you wish to use
  2. Install the version of the software used by that material
  3. forget that anything newer or older exists.
  4. learn how the software works
John Steer-Fowler
John Steer-Fowler
Courses Plus Student 11,734 Points

Yeah, thats the exact method I would recommend to everyone, especially with Rails to be honest. Nice way of breaking it down.

Rodrigo Soares
Rodrigo Soares
2,460 Points

I'm brand new to Ruby and Rails and I can tell I struggled to find out some answers while following the Treebook App development. But at the end of the day I feel like it might took more time to get the answers I was looking for (attr_accessible for example) but now I feel like I got more knowledge on Rails and Ruby generally speaking. The important thing is to go for the answers on the web, here at the forum. Learning should be fun and challenging.

James Barnett
James Barnett
39,199 Points

Out of curiosity Pierre Poujade why are you interested in using Rails 4 and Bootstrap 3. Why those very particular versions?

Have you been using Rails and/or Bootstrap for a while and waiting for particular features that came out in that major version?

Pierre Poujade
Pierre Poujade
7,085 Points

Because they are the latest version and since I'm learning Rails I might as well get used to them. It seems the way attr_accessible is handled in Rails 4 has changed from 3.2 and what is shown in the lessons isn't what happens on my machine.

Besides, the treehouse Vagrant box that we had to install in one of the first lessons ships with Rails 4.

James Barnett
James Barnett
39,199 Points

Might as well get used to them?

As in, any work you do in Rails would necessarily be in that version?

Pierre Poujade
Pierre Poujade
7,085 Points

Like everything in life, it's never black or white. So I wouldn't say “necessarily” but I would say that since it is the latest version then more and more apps are going to be using it as time passes.

Since I am learning with the objective of creating a new app of my own, I'd rather learn the latest version of Rails because this is what I'll be using.

David Langley
David Langley
10,965 Points

Hello chaps interesting discussion. I am just starting to use Ruby for the first time today.

I went through the item in the track to install ruby called "Installing a Ruby Development Environment"

When I come to the first video where we fire up ruby; "Generate a rails application" the environment shown in Jason's terminal doesn't look and act like mine. Is this also due to the fact Jason is referring to Ruby 1.9.3 and i have just installed 2.1.1

Jasons terminal prompt reads; 1.9.3 [~/projects]$

My terminal prompt reads; davids-mbp:~ chickenguts$

Jason ask's as the first task to type "rvm use 1.9.3" and gets response using usr/local/rvm/gems/ruby-1.9.3p194

I type; "rvm use 2.1.1" and get the response ruby-2.1.1 is not installed. when i check using ruby -v I get; ruby 2.1.1p76 (2014-02-24 revision 45161) [x86_64-darwin13.0]

very frustrating..... I am so keen to get started using Ruby and there seems to be allot of hurdles.

really hope you can help. going to post this in the ruby forum also to see if i get some help.

Rodrigo Soares
Rodrigo Soares
2,460 Points

David what do you get when your run ruby -v?

Rodrigo Soares
Rodrigo Soares
2,460 Points

David what do you get when your run ruby -v?

David Langley
David Langley
10,965 Points

Hey Rodrigo

response is;

"ruby 2.1.1p76 (2014-02-24 revision 45161) [x86_64-darwin13.0]"

and when i tell it to use 1.9.3 as outlined in the video (using rmv use 1.9.3) I get;

"ruby-1.9.3-p484 is not installed. To install do: 'rvm install ruby-1.9.3-p484'"

Rodrigo Soares
Rodrigo Soares
2,460 Points

Okay well that means you have ruby latest version installed. What do you get when running rails?

Do you get this?

Usage: rails COMMAND [ARGS]

The most common rails commands are:
 generate    Generate new code (short-cut alias: "g")
 console     Start the Rails console (short-cut alias: "c")
 server      Start the Rails server (short-cut alias: "s")
 dbconsole   Start a console for the database specified in config/database.yml
             (short-cut alias: "db")
 new         Create a new Rails application. "rails new my_app" creates a
             new application called MyApp in "./my_app"

In addition to those, there are:
 application  Generate the Rails application code
 destroy      Undo code generated with "generate" (short-cut alias: "d")
 plugin new   Generates skeleton for developing a Rails plugin
 runner       Run a piece of code in the application environment (short-cut alias: "r")

All commands can be run with -h (or --help) for more information.

if that's the case you have rails and you should check the version rails -v should be 4.0.3

and by the way what tutorial are you following?

David Langley
David Langley
10,965 Points

sorry what do i type at the command prompt to run rails ? sorry to be so slow here, but literally my first day trying Ruby.

I am following the Rails Development Track - Getting started with Rails - Generate a rails application.

Rodrigo Soares
Rodrigo Soares
2,460 Points

just type: rails

what do you get?

David Langley
David Langley
10,965 Points

i get a whole lot !

see below.

/Users/chickenguts/.rbenv/versions/2.1.1/lib/ruby/2.1.0/rubygems/dependency.rb:298:in to_specs': Could not find 'railties' (>= 0) among 20 total gem(s) (Gem::LoadError) from /Users/chickenguts/.rbenv/versions/2.1.1/lib/ruby/2.1.0/rubygems/dependency.rb:309:into_spec' from /Users/chickenguts/.rbenv/versions/2.1.1/lib/ruby/2.1.0/rubygems/core_ext/kernel_gem.rb:53:in gem' from /Users/chickenguts/.rbenv/versions/2.1.1/bin/rails:22:in<main>'

David Langley
David Langley
10,965 Points

Thanks Rodrigo.

I have also installed 1.9.3 of ruby to follow along with Jason.

Are yo running Mavericks OS X 10.9.1 ? when i went to the railsinstaller.org it is asking for people with mavericks to;

"Please do not run the installer on OSX Mavericks until further notice."

is there anywhere else that will do the same thing ??

James Barnett
James Barnett
39,199 Points

> is there anywhere else that will do the same thing

No, Apple changed some things with Mavericks and that will no longer work.

Getting Rails setup in now non-trival with Mavericks, here are some instructions that might help point you in the right direction. Good luck.

Rodrigo Soares
Rodrigo Soares
2,460 Points

I'm not sure about the mavericks . I have OSX Lion. Just Google it. Try to find a substitute for your operating system

David Langley
David Langley
10,965 Points

James

Thats a shame, maybe that can be addressed in the video as Mavericks is the latest operating system.

Putting that aside, you said "here" are some instructions that might help, should there have ben a link there ?

One of the other people in a separate forum thread says i should be able to install it with rvm in the terminal. I am happy to try this way however, looking at railsinstaller.org it looks to have installed a whole package of things not just rails.

Thanks for your help, this is the first time i have really needed to use the forums and i am overwhelmed with peoples generosity.

David Langley
David Langley
10,965 Points

James,

have found a forum thread from december last year on this problem, has there been any revelations since then ? if not i will try some of the advice in there.

looks like this is a problem that is going to come up more with mavericks being standard OS on new Mac's, maybe treehouse can do a video "Installing Rails on Mavericks".....

this is really slowing down my momentum , i have been trying to get back on my learning track for days now....

James Barnett
James Barnett
39,199 Points

> maybe treehouse can do a video "Installing Rails on Mavericks"

Treehouse has a video on installing Ruby / Rails, the video is updated for Mavericks.

However keep in mind after you follow those directions you might want to take my advice (from earlier in this thread) and install the of Ruby, Rails & Bootstrap versions used in the tutorial you are working on.

David Langley
David Langley
10,965 Points

Thanks James, have gone through the whole process and still not working.... when I go to localhost:3000 it tells me I am riding ruby on rails, so assumed the process has worked.

them when I start the "Generate a rails application" and type;

rvm use 1.9.3 as instructed i get; Using /Users/chickenguts/.rvm/gems/ruby-1.9.3-p484 davids-mbp:~ chickenguts$ new rails treebook

which looks correct (hooray!)

then type; "rails new treebook", i get; /Users/chickenguts/.rvm/rubies/ruby-1.9.3-p484/lib/ruby/site_ruby/1.9.1/rubygems/dependency.rb:298:in to_specs': Could not find 'minitest' (~> 4.2) - did find: [minitest-2.5.1] (Gem::LoadError) from /Users/chickenguts/.rvm/rubies/ruby-1.9.3-p484/lib/ruby/site_ruby/1.9.1/rubygems/specification.rb:1268:inblock in activate_dependencies' from /Users/chickenguts/.rvm/rubies/ruby-1.9.3-p484/lib/ruby/site_ruby/1.9.1/rubygems/specification.rb:1257:in each' from /Users/chickenguts/.rvm/rubies/ruby-1.9.3-p484/lib/ruby/site_ruby/1.9.1/rubygems/specification.rb:1257:inactivate_dependencies' from /Users/chickenguts/.rvm/rubies/ruby-1.9.3-p484/lib/ruby/site_ruby/1.9.1/rubygems/specification.rb:1239:in activate' from /Users/chickenguts/.rvm/rubies/ruby-1.9.3-p484/lib/ruby/site_ruby/1.9.1/rubygems/specification.rb:1271:inblock in activate_dependencies' from /Users/chickenguts/.rvm/rubies/ruby-1.9.3-p484/lib/ruby/site_ruby/1.9.1/rubygems/specification.rb:1257:in each' from /Users/chickenguts/.rvm/rubies/ruby-1.9.3-p484/lib/ruby/site_ruby/1.9.1/rubygems/specification.rb:1257:inactivate_dependencies' from /Users/chickenguts/.rvm/rubies/ruby-1.9.3-p484/lib/ruby/site_ruby/1.9.1/rubygems/specification.rb:1239:in activate' from /Users/chickenguts/.rvm/rubies/ruby-1.9.3-p484/lib/ruby/site_ruby/1.9.1/rubygems/core_ext/kernel_gem.rb:48:ingem' from /Users/chickenguts/.rvm/gems/ruby-1.9.3-p484/bin/rails:22:in <main>' from /Users/chickenguts/.rvm/gems/ruby-1.9.3-p484/bin/ruby_executable_hooks:15:ineval' from /Users/chickenguts/.rvm/gems/ruby-1.9.3-p484/bin/ruby_executable_hooks:15:in `<main>'

which does not look like whats happening in the video.... (boooo!)

I have also posted this to support. This is not fun.....