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 Todo List Application with Rails 4 Build a Todo List Application with Rails 4 Set up Git and Add Gems

David Forero
David Forero
5,492 Points

Difference between screencasts and actual ruby rails installation files.

I am following along the videos and got to the part where you have to edit a Gemfile but the files they show in the screencast are different than the files that get installed in my Mac OS X . Please some light to this on how people overcame this obstacle.

Thank you

Kyle Daugherty
Kyle Daugherty
16,441 Points

What's your gemfile look like?

David Forero
David Forero
5,492 Points

My gemfile does not have this code :

group :doc do
  # bundle exec rake doc:rails generates the API under doc/api.
  gem 'sdoc', require: false
end

and instead has this

gem 'sdoc', '~> 0.4.0',          group: :doc
# Spring speeds up development by keeping your application running in the background. Read more: https://github.com/rails/spring
gem 'spring',        group: :development

all other files that need to be edited along the course also have differences

Kyle Daugherty
Kyle Daugherty
16,441 Points

Rails should have added those automatically to your gemfile. You won't need 'sdoc' to follow along the tutorial, but you'll want 'spring' which you can do by:

Adding this to your gemfile:

gem "spring", group: :development

Then from the command line run bundle install.

3 Answers

Kyle Daugherty
Kyle Daugherty
16,441 Points

Your gemfile looks good - you are just using a newer version of Rails. You just need to add rspec and capybara:

group :development, :test do
  gem 'rspec-rails', '~> 2.0'
end

group :test do
  gem 'capybara', '~> 2.1.0'
end

Let us know if you get any errors.

Gavin Ralston
Gavin Ralston
28,770 Points

If you like keeping the "new look" of the Gemfile, you can insert it like this, too:

gem 'sdoc', '~> 0.4.0',         group: :doc
gem 'capybara', '~> 2.1.0',      group: :test
gem 'rspec-rails', '~> 2.0',     group: :test, group: :development

Pay special attention to the last line, there's a comma separating the test group and the development group (it's a hash, just all "syntactic sugary" leaving out the braces)

When you create the new rails application named odot the gemfile should be within there. If you aren't finding the file try creating it again with the 'rails new odot' command. Make sure you know what directory you are in. You should be able to cd odot then ls. The gemfile should be inside.

David Forero
David Forero
5,492 Points

This is the one from Treehouse :

source 'https://rubygems.org'

gem 'rails', '4.0.1'
gem 'sqlite3'
gem 'sass-rails', '~> 4.0.0'
gem 'uglifier', '>= 1.3.0'
gem 'coffee-rails', '~> 4.0.0'
gem 'jquery-rails'
gem 'turbolinks'
gem 'jbuilder', '~> 1.2'

group :doc do
  # bundle exec rake doc:rails generates the API under doc/api.
  gem 'sdoc', require: false
end

group :development, :test do
  gem 'rspec-rails', '~> 2.0'
end

group :test do
  gem 'capybara', '~> 2.1.0'
end

and this one is the one installed when I run rails new odot:

source 'https://rubygems.org'



gem 'rails', '4.1.6'
gem 'sqlite3'
gem 'sass-rails', '~> 4.0.3'
gem 'uglifier', '>= 1.3.0'
gem 'coffee-rails', '~> 4.0.0'
gem 'jquery-rails'
gem 'turbolinks'
gem 'jbuilder', '~> 2.0'
# bundle exec rake doc:rails generates the API under doc/api.
gem 'sdoc', '~> 0.4.0',          group: :doc
gem 'spring',        group: :development