various issues using rails > 3.0.3 #30

agnessa opened this Issue Jun 27, 2011 · 8 comments


None yet

2 participants



my basic setup was rails 3.0.3 + home_run + tiny_tds + activerecord-sqlserver-adapter, which was working fine until at some point I tried to upgrade to rails 3.0.4, which is when I started getting conversion errors related to Date & DateTime types. I disabled home_run as I didn't have time to dig into this back then. Today I found some time to test various configurations and collect some test results. I tested both with MS SQL as well as mysql + different rails versions.

The simple tests I ran can be found here:

and results here:

There are all sorts of errors there. The last version of rails to work correctly with MS SQL is 3.0.3, and 3.0.4 with mysql.

To run the tests you need to manually change the Gemfile (samples for mssql and mysql included).


Did you use home_run --install after installing the home_run gem? If not, did you use the home_run command line utility to run the rails tests (e.g. home_run rake test)? Have you tried doing home_run rails c and creating the FooBar instances manually?

The reason I ask is those errors are likely to be caused by a partially loaded instance of home run (where the stdlib date class was loaded first). If you still have problems after trying those suggestions, please reply here and I'll clone your repository and see if I can figure out what is going wrong.


Thanks for your reply. I did not try these previously, now that I did home_run --install I get:
uninitialized constant Time::DateTime

when trying to run either:

rake test:units
home_run rake test:units

maybe I should add I'm working with rvm.


What's the backtrace for the uninitialized constant Time::DateTime error?


there it goes:

agnessa@treefrog:~/workspace/date_bug_app$ home_run rake test:units RAILS_ENV=test --trace
(in /home/agnessa/workspace/date_bug_app)
rake aborted!
uninitialized constant Time::DateTime
/home/agnessa/.rvm/gems/ruby-1.8.7-p330/gems/activesupport-3.0.9/lib/active_support/core_ext/time/calculations.rb:268:in `-'
/home/agnessa/.rvm/gems/ruby-1.8.7-p330/gems/railties-3.0.9/lib/rails/railtie.rb:185:in `each'
/home/agnessa/.rvm/gems/ruby-1.8.7-p330/gems/railties-3.0.9/lib/rails/railtie.rb:185:in `load_tasks'
/home/agnessa/.rvm/gems/ruby-1.8.7-p330/gems/railties-3.0.9/lib/rails/application.rb:140:in `load_tasks'
/home/agnessa/.rvm/gems/ruby-1.8.7-p330/gems/railties-3.0.9/lib/rails/application/railties.rb:11:in `each'
/home/agnessa/.rvm/gems/ruby-1.8.7-p330/gems/railties-3.0.9/lib/rails/application/railties.rb:11:in `all'
/home/agnessa/.rvm/gems/ruby-1.8.7-p330/gems/railties-3.0.9/lib/rails/application.rb:140:in `load_tasks'
/home/agnessa/.rvm/gems/ruby-1.8.7-p330/gems/railties-3.0.9/lib/rails/application.rb:77:in `send'
/home/agnessa/.rvm/gems/ruby-1.8.7-p330/gems/railties-3.0.9/lib/rails/application.rb:77:in `method_missing'
/home/agnessa/.rvm/gems/ruby-1.8.7-p330/gems/rake-0.8.7/lib/rake.rb:2383:in `load'
/home/agnessa/.rvm/gems/ruby-1.8.7-p330/gems/rake-0.8.7/lib/rake.rb:2383:in `raw_load_rakefile'
/home/agnessa/.rvm/gems/ruby-1.8.7-p330/gems/rake-0.8.7/lib/rake.rb:2017:in `load_rakefile'
/home/agnessa/.rvm/gems/ruby-1.8.7-p330/gems/rake-0.8.7/lib/rake.rb:2068:in `standard_exception_handling'
/home/agnessa/.rvm/gems/ruby-1.8.7-p330/gems/rake-0.8.7/lib/rake.rb:2016:in `load_rakefile'
/home/agnessa/.rvm/gems/ruby-1.8.7-p330/gems/rake-0.8.7/lib/rake.rb:2000:in `run'
/home/agnessa/.rvm/gems/ruby-1.8.7-p330/gems/rake-0.8.7/lib/rake.rb:2068:in `standard_exception_handling'
/home/agnessa/.rvm/gems/ruby-1.8.7-p330/gems/rake-0.8.7/lib/rake.rb:1998:in `run'
/home/agnessa/.rvm/gems/ruby-1.8.7-p330/bin/rake:19:in `load'

Weird. There must be something very weird going on. When you use the home_run command line to execute a program, it sets RUBYLIB=/path/to/home_run/lib and RUBYOPT=-rdate, so both Date and DateTime should be defined. What's the result of:

home_run ruby -e "p"

I'm cloning the repo now to see if I can reproduce.


the output is:
#<DateTime 2011-06-28T17:31:47+02:00>

I've reproduced this on two machines, both of which have the same setup: Ubuntu 10.04 (one machine is 64bit and the other 32bit), rvm, ruby 1.8.7


Figured it out. You need the following in your Gemfile:

gem 'home_run', :require=>'date'

Otherwise bundler will require 'home_run' instead of 'date'. I should probably add that to the README.


cool, thanks for your help!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment