# Ruby 1.8.5/6 and Rails 1.2.3 on Mac OS X 10.4.9 (Intel)

**URL:** <https://www.ruby-forum.com/t/ruby-1-8-5-6-and-rails-1-2-3-on-mac-os-x-10-4-9-intel/89531>\
**Category:** Rails\
**Created:** [March 21, 2007, 12:24am UTC](https://www.ruby-forum.com/t/ruby-1-8-5-6-and-rails-1-2-3-on-mac-os-x-10-4-9-intel/89531 "2007-03-21T00:24:03Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![casper\_the\_ghost](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/58956e/32.png) [@casper\_the\_ghost](https://www.ruby-forum.com/u/casper_the_ghost)\
**Post date:** [March 21, 2007, 12:24am UTC](https://www.ruby-forum.com/t/ruby-1-8-5-6-and-rails-1-2-3-on-mac-os-x-10-4-9-intel/89531/1 "2007-03-21T00:24:03Z")

</div>

I have encountered a very strange error thanks to my unit tests. I am  
developing an application on a MacBook Pro running Mac OS X 10.4.9,  
having installed Ruby, Rails, RubyGems, Mongrel, MySQL, and Subversion  
based on Hivelogic’s instructions at

> **[Dan Benjamin](https://danbenjamin.com)**
>
> Dan Benjamin's personal website.

My rails installation is located in my project’s vendor/rails  
directory with rails _not installed_ via gems on either computer.

Everything installed fine and everything seems to run fine. However, I  
encountered a few peculiar errors.

Running ‘rake test’ on my MacBook Pro would result in successfully  
passing tests. However, when I checked out my project on my FreeBSD  
development box, running ‘rake test’ turned up numerous errors.

I added some more tests and checked some existing ones and it turned  
out that my MacBook Pro wasn’t catching assertions or errors that it  
should have.

One error that showed up on both machines was in an integration test  
which was using the ‘put’ method.

On my MacBook Pro:

1. Error:  
test\_edit\_already\_processed\_po(BuyerTest):  
NoMethodError: undefined method `recycle!' for #<ActionController::CgiRequest:0x3360b98> /Users/username/svn/p2/config/../vendor/rails/actionpack/lib/ action_controller/cgi_process.rb:140:in `method\_missing’  
/Users/username/svn/p2/config/…/vendor/rails/actionpack/lib/  
action\_controller/test\_process.rb:370:in `process' /Users/username/svn/p2/config/../vendor/rails/actionpack/lib/ action_controller/test_process.rb:353:in `put’  
buyer\_test.rb:142:in `test_edit_already_processed_po' /Users/username/svn/p2/config/../vendor/rails/actionpack/lib/ action_controller/integration.rb:453:in `run’

On the FreeBSD Box:

1. Error:  
test\_edit\_already\_processed\_po(BuyerTest):  
NoMethodError: undefined method `recycle!' for #<ActionController::CgiRequest:0x98e9bb8> /usr/home/username/svn/p2/config/../vendor/rails/actionpack/lib/ action_controller/cgi_process.rb:140:in `method\_missing’  
/usr/home/username/svn/p2/config/…/vendor/rails/actionpack/lib/  
action\_controller/test\_process.rb:370:in `process' /usr/home/username/svn/p2/config/../vendor/rails/actionpack/lib/ action_controller/test_process.rb:353:in `put’  
buyer\_test.rb:142:in `test_edit_already_processed_po' /usr/home/username/svn/p2/config/../vendor/rails/actionpack/lib/ action_controller/integration.rb:453:in `run’

I found the [dev.rubyonrails.org](http://dev.rubyonrails.org) ticket associated with this error at  
[http://dev.rubyonrails.org/ticket/6353](http://dev.rubyonrails.org/ticket/6353)

In the third comment, the user caboose, comments that if your  
installation is broken you’ll see one set of errors, but if your  
installation works, you will see an extra set of errors… both my  
MacBook Pro and my FreeBSD box show the first set of errors, which  
according to caboose, means my installation is broken on both of my  
machines. However, both machines still report back different results  
on other tests, some that succeed on my MacBook still fail on my  
FreeBSD box, with the FreeBSD box being correct on the errors that I  
have checked. Unfortunately, caboose doesn’t point to what the problem  
could be or any sort of solution.

Continuing with the perspective that my FreeBSD install was at least  
_more correct_ than my MacBook install, I focused on one test in  
particular where it failed on my MacBook but succeeds on my FreeBSD  
box. This is a simple ‘validates\_presence\_of :created\_by, :on  
=\> :create’ which does not add an error to the object when it should  
on my MacBook, but succeeds in adding an error on my FreeBSD box as it  
should.

MacBook Pro:

Loaded suite test/unit/location\_test  
Started  
…F…  
Finished in 0.093381 seconds.

1. Failure:  
test\_should\_require\_created\_by(LocationTest) [test/unit/  
location\_test.rb:38]:  
 is not true.

7 tests, 18 assertions, 1 failures, 0 errors

FreeBSD Server:

Loaded suite test/unit/location\_test  
Started  
…  
Finished in 0.142679 seconds.

7 tests, 18 assertions, 0 failures, 0 errors

Again, the FreeBSD server is the correct result. The MacBook Pro is  
incorrect.

I installed identical versions of ruby, mysql, and rake on my MacBook  
Pro to match the FreeBSD server. The results are the same.

I installed Ruby 1.8.6 on the MacBook Pro, same results. I reinstall  
Ruby 1.8.5 without readline, same results, without pthreads, same  
results.

So, time to run rail’s tests to see if they throw any different  
errors.

MacBook Pro:

rake test  
(in /Users/username/svn/p2/vendor/rails/railties)  
Loaded suite test/dispatcher\_test  
Started  
FF…  
Finished in 0.148324 seconds.

1. Failure:  
test\_ac\_subclasses\_cleared\_on\_reset(DispatcherTest)  
[test/dispatcher\_test.rb:139:in `assert_subclasses' test/dispatcher_test.rb:45:in `test\_ac\_subclasses\_cleared\_on\_reset’]:  
[“DispatcherControllerTest”].  
\<0\> expected but was  
\<1\>.

2. Failure:  
test\_am\_subclasses\_cleared\_on\_reset(DispatcherTest)  
[test/dispatcher\_test.rb:139:in `assert_subclasses' test/dispatcher_test.rb:54:in `test\_am\_subclasses\_cleared\_on\_reset’]:  
[“DispatcherTestMailer”].  
\<0\> expected but was  
\<1\>.

5 tests, 19 assertions, 2 failures, 0 errors  
rake aborted!  
Failures

FreeBSD Server:

rake test  
(in /usr/home/username/svn/p2/vendor/rails/railties)  
Skipping dispatcher tests. `gem install mocha` and try again.  
Loaded suite test/fcgi\_dispatcher\_test  
Started

Finished in 0.000244 seconds.

0 tests, 0 assertions, 0 failures, 0 errors  
Loaded suite test/plugin\_test  
Started  
…  
Finished in 0.022597 seconds.

11 tests, 20 assertions, 0 failures, 0 errors  
Loaded suite test/rails\_generator\_test  
Started  
…FF…  
Finished in 0.08259 seconds.

1. Failure:  
test\_named\_generator\_attributes(RailsGeneratorTest) [test/  
rails\_generator\_test.rb:108]:  
\<“foos”\> expected but was  
\<“admin\_foos”\>.

2. Failure:  
test\_named\_generator\_attributes\_without\_pluralized(RailsGeneratorTest)  
[test/rails\_generator\_test.rb:115]:  
\<“foo”\> expected but was  
\<“admin\_foo”\>.

10 tests, 35 assertions, 2 failures, 0 errors  
rake aborted!  
Failures

Nice to get some different results, but they still fail.

This is where I am at now. If anyone has any advice, please let me  
know.

Cheers.

---

<div class="post-metadata">

**Author:** ![casper\_the\_ghost](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/58956e/32.png) [@casper\_the\_ghost](https://www.ruby-forum.com/u/casper_the_ghost)\
**Post date:** [March 21, 2007, 1:16am UTC](https://www.ruby-forum.com/t/ruby-1-8-5-6-and-rails-1-2-3-on-mac-os-x-10-4-9-intel/89531/2 "2007-03-21T01:16:10Z")

</div>

I’ve moved onto trying to simply check out rails from its repository  
and run its tests, however even this is unclear.

Following the directions under Creating a patch at  
[http://dev.rubyonrails.org/](http://dev.rubyonrails.org/)  
i have checked out the 1-2-stable branch, but it’s not clear how to  
run the unittests… activerecord has its own set, which I have run  
successfully (albeit it reported 1 failure and 1 error), and running  
‘rake test’ and ‘rake regular\_test’ under railties throws a number of  
errors and failures…

Anyone know what the wiki expects you to do when it states, “Ensure  
that the existing unit tests pass”? Because all of the tests I could  
find fail in some way or another.

---

<div class="post-metadata">

**Author:** ![casper\_the\_ghost](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/58956e/32.png) [@casper\_the\_ghost](https://www.ruby-forum.com/u/casper_the_ghost)\
**Post date:** [March 21, 2007, 10:55pm UTC](https://www.ruby-forum.com/t/ruby-1-8-5-6-and-rails-1-2-3-on-mac-os-x-10-4-9-intel/89531/3 "2007-03-21T22:55:53Z")

</div>

I have solved my own problem which turned out to be an incorrect  
migration of the database structure in the development and test  
environments on my MacBook. I discovered this by analyzing the DB  
structure between my local machine and my FreeBSD box. Not sure why  
this was the case… if it happens again I will debug, but for now if  
you encounter the same problem, check your database structures!

Cheers.

---

<div class="post-metadata">

**Author:** ![casper\_the\_ghost](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/58956e/32.png) [@casper\_the\_ghost](https://www.ruby-forum.com/u/casper_the_ghost)\
**Post date:** [March 21, 2007, 11:12pm UTC](https://www.ruby-forum.com/t/ruby-1-8-5-6-and-rails-1-2-3-on-mac-os-x-10-4-9-intel/89531/4 "2007-03-21T23:12:54Z")

</div>

Update on Rails own tests…

Check out [http://hasmanythrough.com/layingtracks/](http://hasmanythrough.com/layingtracks/) for a good overview.

Rails does not have its own single rakefile to test everything all at  
once. I do not know why this is.

You must test each package individually (actionpack, activerecord,  
etc).

The tests in railties are “supposed” to fail. Meaning, they have been  
neglected and fail for everyone (I assume).

I contacted the author of Laying Tracks (link above), and he indicated  
that an updated version of this material will be created next month  
and hopefully live on the [dev.rubyonrails.org](http://dev.rubyonrails.org) wiki. Cheers to that.
