Updating gems for ruby 1.9

Hi,

This might have been discussed somewhere else already, if this is the case, I apologize.

I publish a significant number of gems. These were all designed for Ruby 1.8. Apart from syntax and functional changes, how to I ensure that it is possible to use these gems with Ruby 1.9?

I haven't really used Ruby 1.9 much, but when I install a gem, it seems like it is installed for a particular version of Ruby.. on my Mac:

  /Library/Ruby/Gems/1.8

Does this mean that the gem command that you use will determine where the gems are installed? Is there a different gem command for 1.8 and for 1.9?

I use the gem server to publish my gems. Do I need to use the 1.9 version of gem server in order to provide gems for Ruby 1.9? (I'm assuming I probably don't, but it would be good to clarify).

Provided everything is working okay, should I be using Ruby 1.9 gem server for publishing gems to both Ruby 1.8 and Ruby 1.9?

When I stand back a little bit, this seems fairly complicated - maybe more so than it needs to be.

Any clarification would be most welcome.

Kind regards,
Samuel

Hi,

This might have been discussed somewhere else already, if this is the case,
I apologize.

I publish a significant number of gems. These were all designed for Ruby
1.8. Apart from syntax and functional changes, how to I ensure that it is
possible to use these gems with Ruby 1.9?

you don't have to do anything special. If your gems (and all dependent gems)
work with ruby 1.9 everything is fine.

I haven't really used Ruby 1.9 much, but when I install a gem, it seems
like it is installed for a particular version of Ruby.. on my Mac:

       /Library/Ruby/Gems/1.8

Does this mean that the gem command that you use will determine where the
gems are installed?

yes. rubygems use different places to store the gems - depending on your
Ruby version.

Is there a different gem command for 1.8 and for 1.9?

no.

-Thomas

···

2009/8/29 Space Ship Traveller <space.ship.traveller@gmail.com>

--
Thomas Preymesser
thopre@gmail.com

Pablo Picasso<http://www.brainyquote.com/quotes/authors/p/pablo_picasso.html&gt;
- "Computers are useless. They can only give you answers."

Thanks.

If the gem doesn't need to be changed between versions of ruby, why is it installed into a version dependent sub-directory?

Is it possible to install a gem for all versions of ruby?

Kind regards,
Samuel

yes*

* If your ruby 1.9 installation was configured with --program-suffix, this suffix will be used to determine the gem command's name. For example ./configure --program-suffix=19 gives you ruby19 and gem19. You'll probably also want to set --format-executable in ~/.gemrc (see gem help env).

···

On Aug 29, 2009, at 11:02, Thomas Preymesser wrote:

Is there a different gem command for 1.8 and for 1.9?

no.

Not by default.

You can set GEM_HOME and GEM_PATH to force RubyGems to use a common path. See gem help env.

···

On Aug 29, 2009, at 11:10, Space Ship Traveller wrote:

Is it possible to install a gem for all versions of ruby?

Out of curiosity, why was this decision made? It seems like it would be easier to have a combined directory for 1.8 and 1.9?

Kind regards,
Samuel

···

On 1/09/2009, at 11:06 AM, Eric Hodel wrote:

On Aug 29, 2009, at 11:10, Space Ship Traveller wrote:

Is it possible to install a gem for all versions of ruby?

Not by default.

You can set GEM_HOME and GEM_PATH to force RubyGems to use a common path. See gem help env.

C extensions can only be linked against one version.

···

On Sep 2, 2009, at 20:32, Space Ship Traveller wrote:

On 1/09/2009, at 11:06 AM, Eric Hodel wrote:
On Aug 29, 2009, at 11:10, Space Ship Traveller wrote:

Is it possible to install a gem for all versions of ruby?

Not by default.

You can set GEM_HOME and GEM_PATH to force RubyGems to use a common path. See gem help env.

Out of curiosity, why was this decision made? It seems like it would be easier to have a combined directory for 1.8 and 1.9?

Thats a good reason :slight_smile: maybe?

I can understand why it is that way.

Thanks for the clarification I appreciate your knowledge.
Samuel

···

On 3/09/2009, at 4:56 PM, Eric Hodel wrote:

On Sep 2, 2009, at 20:32, Space Ship Traveller wrote:

On 1/09/2009, at 11:06 AM, Eric Hodel wrote:
On Aug 29, 2009, at 11:10, Space Ship Traveller wrote:

Is it possible to install a gem for all versions of ruby?

Not by default.

You can set GEM_HOME and GEM_PATH to force RubyGems to use a common path. See gem help env.

Out of curiosity, why was this decision made? It seems like it would be easier to have a combined directory for 1.8 and 1.9?

C extensions can only be linked against one version.