Version Control (and gems)

  1. Full version control of a web app would include the constellation
    of gems actually used. I can do ‘gem list’ and put that into a file
    in version control but that could include unused gems. That is, it
    could include gems use by other projects.

And putting the whole gem in version control seem like overkill since
the authors do that. But it might be safer.

Do we have a utility that will generate a script to re-fetch the gems
at the exact version numbers I’m using now?

I can easily put plugins in the VC system, but gems are in a different
place. I suppose I could create some sort of link from my working
directory to GEM_HOME or even to the places on GEM_PATH but that seems
like a pain.

QUESTION: So what are the best practices for version control and
gems?

And does the answer change if I use git instead of svn?
(And is one really better than the other for rails projects?)

F

On 15 Apr 2008, at 18:14, fredistic wrote:

at the exact version numbers I’m using now?

Edge rails has this. You define in your config which gems (possibly
locking it to a particular version) and then there’s a rake task to go
get them all.

Fred

Oh wow. Way cool.

And the rake task puts them in $GEM_HOME or do you specify on the
command line? Or does it just go to the ‘regular place’ ruby gem
directory only? The version numbers should protect us, I know, but
sometimes it pays to be paranoid.

There’s a $GEM_PATH variable we can use to tell ruby where to look for
gems. If I was re-creating an older version of some app from version
control I might not want that old gem in the regular place. I’d put
it someplace special and use $GEM_PATH or $GEM_HOME.

On the other hand I might have reverted to an older version of Ruby so
the ‘regular place’ might be just right.

F

P.S. While mineral gems might be more valuable when old, software
gems often are not…

On 15 Apr 2008, at 19:17, fredistic wrote:

Oh wow. Way cool.

And the rake task puts them in $GEM_HOME or do you specify on the
command line? Or does it just go to the ‘regular place’ ruby gem
directory only? The version numbers should protect us, I know, but
sometimes it pays to be paranoid.

don’t know off the top of my head I’m afraid.

Fred

You could create a rake tasks which downloads the right gems with right
versions. And there is a gem command to ‘load a certain version’ of
them, too.

Fred T. wrote:

  1. Full version control of a web app would include the constellation
    of gems actually used. I can do ‘gem list’ and put that into a file
    in version control but that could include unused gems. That is, it
    could include gems use by other projects.

And putting the whole gem in version control seem like overkill since
the authors do that. But it might be safer.

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs