From: David Vallner Date: 2006-12-05T07:34:24+09:00 Subject: Re: specifying a gem version --------------enig6EDA7A5D1C9826EB06675E9B Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Brian Mr. wrote: > I'm new to ruby so I have no clue what I'm doing yet here. I downloade= d > active_merchant code and attempted to run some tests using > active_support 1.3.1. That work just fine for me. I upgraded rails to= > 1.2rc1 and it then downloaded active_support 1.3.1.5618. When I attemp= t > to run the same tests now with active_support I'm getting an error > because of the new version of active support. I was thinking I could > just specify the older version of active_support and all would be well > but that doesn't seem to be working. Instead of doing: >=20 > begin > require 'active_support' > rescue LoadError > require 'rubygems' > require_gem 'activesupport' > end >=20 > I changed this to: >=20 > begin > require 'rubygems' > require_gem 'activesupport', '<=3D1.3.1' > rescue LoadError > require 'rubygems' > require_gem 'activesupport' > end >=20 > I also tried just putting in require_gem 'activesupport', '1.3.1' with > no luck. The error I get is something like 'mattr_accessor' is > undefined. I've read that you can specify the version of a gem so I > must be doing something stupid here. I have put in a ticket on the > rails list about this issue with activesupport but I was hoping to work= > around the issue til it was fixed. Thanks in advance. >=20 Do you -need- the newer version of AS or are you just chasing higher version numbers? Or did rails pick up the incompatible version as a dependency? If the former is the case, wipe clean, and just use the version rails asks for. If the latter, if that's somehow Rails-specific code, maybe the activesupport gem was already loaded at the bad version before by the test launcher, I don't think different gem versions can at all run side-by-side. David Vallner --------------enig6EDA7A5D1C9826EB06675E9B Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.5 (MingW32) iD8DBQFFdKJsy6MhrS8astoRApy3AJ932GuE4cqAJ5xf8PeEE5AcTiGEyQCeKLJN C29pOw7y7FjLgLm2n6k/AKs= =/p0P -----END PGP SIGNATURE----- --------------enig6EDA7A5D1C9826EB06675E9B--