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 Write Our First Tests

rake spec test aborted

I've fixed two errors in my bin/rake spec test, but can't seem to figure out the fix for the last error or two.

--------------Console Dump---------------------------

$ bin/rake spec rake aborted! NoMethodError: undefined method `to_time_preserves_timezone=' for ActiveSupport:Module

/home/harold/Documents/RubyProjects/todo/config/initializers/new_framework_defaults.rb:15:in `<top (required)>'

/home/harold/.rvm/gems/ruby-2.3.1@rails5.0.0/gems/activesupport-4.0.6/lib/active_support/dependencies.rb:223:in `load'

/home/harold/.rvm/gems/ruby-2.3.1@rails5.0.0/gems/activesupport-4.0.6/lib/active_support/dependencies.rb:223:in `block in load'

/home/harold/.rvm/gems/ruby-2.3.1@rails5.0.0/gems/activesupport-4.0.6/lib/active_support/dependencies.rb:214:in `load_dependency'

/home/harold/.rvm/gems/ruby-2.3.1@rails5.0.0/gems/activesupport-4.0.6/lib/active_support/dependencies.rb:223:in `load'

/home/harold/.rvm/gems/ruby-2.3.1@rails5.0.0/gems/railties-4.0.6/lib/rails/engine.rb:609:in `block (2 levels) in <class:Engine>'

/home/harold/.rvm/gems/ruby-2.3.1@rails5.0.0/gems/railties-4.0.6/lib/rails/engine.rb:608:in `each'

/home/harold/.rvm/gems/ruby-2.3.1@rails5.0.0/gems/railties-4.0.6/lib/rails/engine.rb:608:in `block in <class:Engine>'

/home/harold/.rvm/gems/ruby-2.3.1@rails5.0.0/gems/railties-4.0.6/lib/rails/initializable.rb:30:in `instance_exec'

/home/harold/.rvm/gems/ruby-2.3.1@rails5.0.0/gems/railties-4.0.6/lib/rails/initializable.rb:30:in `run'

/home/harold/.rvm/gems/ruby-2.3.1@rails5.0.0/gems/railties-4.0.6/lib/rails/initializable.rb:55:in `block in run_initializers'

/home/harold/.rvm/gems/ruby-2.3.1@rails5.0.0/gems/railties-4.0.6/lib/rails/initializable.rb:44:in `each'

/home/harold/.rvm/gems/ruby-2.3.1@rails5.0.0/gems/railties-4.0.6/lib/rails/initializable.rb:44:in `tsort_each_child'

/home/harold/.rvm/gems/ruby-2.3.1@rails5.0.0/gems/railties-4.0.6/lib/rails/initializable.rb:54:in `run_initializers'

/home/harold/.rvm/gems/ruby-2.3.1@rails5.0.0/gems/railties-4.0.6/lib/rails/application.rb:215:in `initialize!'

/home/harold/.rvm/gems/ruby-2.3.1@rails5.0.0/gems/railties-4.0.6/lib/rails/railtie/configurable.rb:30:in `method_missing'

/home/harold/Documents/RubyProjects/todo/config/environment.rb:5:in `<top (required)>'

/home/harold/.rvm/gems/ruby-2.3.1@rails5.0.0/gems/activesupport-4.0.6/lib/active_support/dependencies.rb:229:in `require'

/home/harold/.rvm/gems/ruby-2.3.1@rails5.0.0/gems/activesupport-4.0.6/lib/active_support/dependencies.rb:229:in `block in require'

/home/harold/.rvm/gems/ruby-2.3.1@rails5.0.0/gems/activesupport-4.0.6/lib/active_support/dependencies.rb:214:in `load_dependency'

/home/harold/.rvm/gems/ruby-2.3.1@rails5.0.0/gems/activesupport-4.0.6/lib/active_support/dependencies.rb:229:in `require'

/home/harold/.rvm/gems/ruby-2.3.1@rails5.0.0/gems/railties-4.0.6/lib/rails/application.rb:189:in `require_environment!'

/home/harold/.rvm/gems/ruby-2.3.1@rails5.0.0/gems/railties-4.0.6/lib/rails/application.rb:250:in `block in run_tasks_blocks'

/home/harold/.rvm/gems/ruby-2.3.1@rails5.0.0/gems/rspec-rails-3.5.2/lib/rspec/rails/tasks/rspec.rake:26:in `block (2 levels) in <top (required)>'

Tasks: TOP => test:prepare => db:test:prepare => environment (See full trace by running task with --trace)

--------Console Dump end ----------------

So how do I fix it?

I upgraded both rails (to 4.0.6) and rspec-rails (to 3.5.2) to remove the other two errors. and I am doing this in Zorin Linux (Zorin is Ubuntu based)

Jay McGavren
Jay McGavren
Treehouse Teacher

Hi, billwerba , sorry you've been having trouble!

I tried installing a Rails environment similar to yours (Ruby 2.3.1 and Rails 4.0.6) to help troubleshoot, but I'm having issues with the Rails dependencies. I suspect that the error you're seeing is also due to a version conflict between Ruby 2.3.1 and Rails 4.0.6, or maybe between Rails 5 and Rails 4 (since it appears you've installed Rails 4 within your Rails 5 RVM gemset). Version conflicts are a pain for everyone!

Build a TODO List Application with Rails 4 is an older course; we're actually retiring it two days from now, in part due to issues like this. Can I recommend switching to our new Ruby on Rails 5 Basics course? You should have a much easier time installing the needed libraries, and you'll be learning the latest Rails API!