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

Out of date information in training video! Fix included. (Ruby on Rails)

A real game-stopping error is present in the video Build a Simple Ruby on Rails Application > Creating an Authentication System > Installing Devise

In the video, we are taught how to integrate 'Devise' into our ruby project.

Here are the steps as found in the video:

  1. Add " gem: 'devise' " to the Gemfile (line 9)
  2. In terminal/command prompt, type " bundle " (Providing you're running rvm 1.9.3)
  3. In terminal type " rails generate devise: install "
  4. Follow devise' integration instructions

These steps will 100% come rain or shine cause a complete failure of your site. The server throws this error:

Install does not respond to 'devise' method. This usually means you haven't loaded your ORM file or it's being loaded too late.

Why? I think it's because of differing versions of devise. The version of devise in the video is 2.1.2, whereas the version that's now downloaded is 2.2.3. The process appears to be slightly different with 2.2.3, but different enough to render the current video's instructions obsolete!

Here's what should be done:

  1. Add " gem: 'devise " to the Gemfile (line 9)
  2. Navigate to config > routes.rb. On line 2, comment out or delete " devise_for :installs "
  3. In terminal/command prompt, type " bundle " (Providing you're running rvm 1.9.3)
  4. In terminal type " rails generate devise: install "
  5. Follow devise' integration instructions

It's impossible to keep these videos 100% up to date, but this is a game-stopper, so I thought I'd report it! Really strange stuff (which, frankly I don't understand) occurs if you follow the video's instructions with devise 2.2.3. When you run " rails generate devise: install " for example, you get this:

Hurleys-MacBook-Pro:book hurley$ rails generate devise: install
  invoke  active_record
  create    db/migrate/201567213221751_devise_create_installs.rb
  create    app/models/install.rb
  invoke    test_unit
  create      test/unit/install_test.rb
  create      test/fixtures/installs.yml
  insert    app/models/install.rb
  route  devise_for :installs

3 Answers

James Barnett
James Barnett
39,199 Points

Jonathan - QA issues with the videos like this are best reported to the Treehouse support team directly via email at help@teamtreehouse.com so the Teacher can hopefully add this to the teacher's note section below the video.

In cases where you've solved the issue it's great to also post on the forum to give a quick heads up to your fellow Treehouse members who may be searching at this very issue.

FWIW: I just generated a brand new app and 'devise' installed just fined with the quoted steps. Also, on brand new apps there isn't a line devise_for :installs in my Gemfile. I'm running Rails 3.2.13, ruby 1.9.3p392 and devise 2.2.3.

I have added my devise gem, but when I go to bundle it throws errors...

" Gem::Installer::ExtensionBuildError: ERROR: Failed to build gem native extension.

... An error occurred while installing bcrypt-ruby (3.1.1), and Bundler cannot continue. Make sure that gem install bcrypt-ruby -v '3.1.1' succeeds before bundling. "

I looked around and it seems that there is something about native extensions, but I can't tell what to do.

I hope you have some insight here because it's definitely a road block for this part of the series.

Hey Jonathan,

Thanks for letting everyone know!