On Jan 12, 2009, at 5:29 PM, Matthew Pounsett wrote:

>
> Rob Biedenharn wrote:
>> You might want to see where the various version of your gems are
>> located:
>>  gem list -d activerecord
>>
>> I suspect your attempts at installing gems are not affecting the ones
>> inside the Locomotive bundle.
>
> Since I'm using the 'gem' from inside my Locomotive bundle, I would
> expect it to update gems there.. not somewhere else.. but yes that  
> might
> be an incorrect assumption.
>
> % which gem
> /Applications/Locomotive2/Bundles/standardRailsSept2006.locobundle/ 
> i386/bin//gem
>
> % gem list -d activerecord
>
> *** LOCAL GEMS ***
>
> activerecord (1.15.0, 1.14.4)
>    Implements the ActiveRecord pattern for ORM.
>
> This seems to imply that was updated, doesn't it?

More recent version of gem give you a bit more information:

$ gem list -d activerecord

*** LOCAL GEMS ***

activerecord (2.1.2, 2.1.0, 2.0.2, 1.15.6, 1.15.5, 1.15.3)
     Author: David Heinemeier Hansson
     Rubyforge: http://rubyforge.org/projects/activerecord
     Homepage: http://www.rubyonrails.org
     Installed at (2.1.2): /Library/Ruby/Gems/1.8
                  (2.1.0): /Library/Ruby/Gems/1.8
                  (2.0.2): /Library/Ruby/Gems/1.8
                  (1.15.6): /System/Library/Frameworks/Ruby.framework/ 
Versions/1.8/usr/lib/ruby/gems/1.8
                  (1.15.5): /Library/Ruby/Gems/1.8
                  (1.15.3): /System/Library/Frameworks/Ruby.framework/ 
Versions/1.8/usr/lib/ruby/gems/1.8

     Implements the ActiveRecord pattern for ORM.

>
>
>
>> Note that this error is happening from within the Locomotive bundled
>> activerecord-1.14.4
>
> Given that it seems that 1.15 is present, how do I affect which one  
> gets
> used?

Normallly, you can control which version of a gem with:

require 'rubygems'
gem 'activerecord', '=1.15.6'

But Rails expects a consisted set of gems between ActiveRecord,  
ActiveSupport, and ActionPack (views and controllers).  You might be  
able to specify a rails version (and it will specify all the versions  
that it wants).

>
>
>> Possibly even more importantly, this is in the abstract adapter  
>> rather
>> than, say, the MySQL adapter.
>>
>> What database is defined in your config/database.yml file?  Do you
>> have that adapter installed?  Does it support the :decimal type?
>
> I'm using the mysql adapter.  It worked well enough to get through the
> first migration (creating the relevant table and the first  
> columns).  I
> have no way of identifying what types the adapter supports, other than
> possibly trying a bunch of things.. but that only tells us something  
> if
> the adapter is working as expected (which it might not be).
>
>> Do you get the same/similar error if you change :decimal to :float  
>> (or
>> perhaps :real)?
>
> Changing :decimal (from the example) to :float allows the migration to
> proceed.  I'm not sure what information to take from that.. is this
> because the wrong version of activerecord is being used, and :float  
> has
> been replaced with :decimal in 1.15?  Is it because there's something
> wrong with the mysql adapter and only one of the two works?   It seems
> like there could be a half-dozen different reasons for that, and I'm  
> not
> sure which way to go in order to make my install conform more  
> closely to
> what's expected by the book.

I'd say that the version of the MySQL connection adapter you have does  
not support the :decimal type (regardless of the underlying version of  
the MySQL database).  :float and :decimal are separate types so (at  
least in current versions) both exist (and work!).

If the particular Locomotive bundle is meant to have the "not quite  
1.2" Rails version expected by the ADWR2, then I'd have also expected  
it to work.  (Even if it was a Rails 1.2, it ought to be working.)

-Rob

Rob Biedenharn          http://agileconsultingllc.com
[email protected]


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Talk" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to