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

Setting up the Gemfile for building a todo list application 4

My version is newer than the instructors and it was noted that the process could be different than that shown in the video. I have set up one of these before and now it is different. this is what I have done to the Gemfile....

source 'https://rubygems.org'

gem 'rails', '4.2.5' gem 'sqlite3' gem 'sass-rails', '~> 5.0' gem 'uglifier', '>= 1.3.0' gem 'coffee-rails', '~> 4.1.0' gem 'jquery-rails' gem 'turbolinks' gem 'jbuilder', '~> 2.0

gem 'sdoc', '~> 0.4.0', group: :doc

Use ActiveModel has_secure_password

gem 'bcrypt', '~> 3.1.7'

Use Unicorn as the app server

gem 'unicorn'

Use Capistrano for deployment

gem 'capistrano-rails', group: :development

group :development, :test do gem 'rspec-rails', '~> 2.0' # Call 'byebug' anywhere in the code to stop execution and get a debugger console gem 'byebug' end group :test do gem 'capybara', '~> 2.1.0' end

group :development do # Access an IRB console on exception pages or by using <%= console %> in views gem 'web-console', '~> 2.0'

# Spring speeds up development by keeping your application running in the background. Read more: https://github.com/rails/spring gem 'spring' end (In addition to this there is no spec file.........??????)

2 Answers

Seth Reece
Seth Reece
32,867 Points

Hi Nigeria,

I'm not sure of your full question here. In general, I check github, and rubygems for current gem versions when setting up my gem file. It is important to lock in your gem versions. An example would be: there are some big differences between rspec 2.x and 3.x. If another developer went to work on you project, this would lock in 2.x so no changes to the projects are needed. As for no spec file, remember that you have to run rails g rspec:install after you bundle.

Thanks Seth, if i really knew how to describe in detail what the problem was then I would probably know how to fix it. I gather that github would have some sort of way to fix my problem. My problem is that I have a version of rails that is different from the video tutorials on treehouse. If you look at the way my gemfile is set up(pasted in the description above), and the way the tutorial is set up with a 2.1.0 version of capybara, and 2.0 version of rspec you can see that the instructions are a little obsolete. If you can instruct me how to set up my gemfile for a later version like 4.2.0 of rails I would appreciate it. Sometimes I write vague because I assume that you would understand the problem of what I am writing about. Thanks for your patients! lol ....... I am sorry Seth I do not think that I would know how to make my question any clearer. I might make it easier if you take a look at the Treehouse video tutorial. The Video stated that someone on the forum would probably be able to help if one had a later version than that shown in the tutorial. I was mentioning that I have set up this same todo list previously and now the gemfile looks different with a newer version of Rails.

Seth Reece
Seth Reece
32,867 Points

The way your gem file is set up should be fine. Jason uses rails 4.x for Odot. In his previous course, Treebook, he used rails 3.x, and 4.x switched to strong params for databases. (Don't worry too much about that for now.) The main gems to worry about in Odot are rspec, and shoulda-matchers (when you get there). In rspec 2.x there is one configuration file; spec_helper.rb. In rspec 3.x there are two; rails_helper.rb, and spec_helper.rb. This difference requires a pretty thorough refactoring of the entire app. When you do get to adding the shoulda-matchers gem, this thread explains what to do for the version 3.x. Hope that helps.

Never mind!