dcsimg

Rip: A New Way to Package Ruby Software

Tired of juggling Ruby gems? Try Rip. It's a one-size-fits-all, no fuss, powerful package manager.

If you work on multiple Ruby projects concurrently, you’re probably accustomed to juggling gems. One project requires one batch of gems; another effort depends on a different set; and a third project utilitizes a specific legacy gem. Thankfully, the Ruby gem system can maintain multiple versions of the same gem in a single repository, making much of this task easy. If you need an explicit version of a gem (or any late model version, such as 3.x), simply install the code you need and name the dependency.

For example, if your code depends on Diamond v1.0.1, you can install that version of the gem with…

$ sudo gem install Diamond -v 1.0.1

… and include the gem with the statement…

gem 'Diamond', '= 1.0.1’

But what if you want to test your code with different versions of the same gem? Worse, what if each variant of the gem depends on multiple versions of other gems? Soon you are wrestling with a morass of interdependencies and no effective technique to enforce and ensure revision locking among any prescribed subset.

One solution is a virtual machine per configuration. Create a base image and create an instance for each permutation. That’s workable, albeit very time-consuming to establish and practice.

Still, the notion is the correct one: Create a virtual environment for each subset of gems and switch quickly and easily to the appropriate environment for each test. A similar notion is equally useful: Create multiple environments and run multiple, complex applications concurrently, each in its own “box.”

A virtual environment is just one feature of the new—as in version 0.0.1—Rip package manager created by Chris Wanstrath and a small team of developers at Github. As the project home page attests, “Rip is an attempt to create a next generation packaging system for Ruby,” and simplifying package interdependencies is a top priority.

Packages Simplified

Inspired by Python’s virtualenv (a virtual environment builder) and pip (an alternative package installer), Rip offers several improvements over Ruby’s native gem package manager.

  • Creating and sharing a package is a snap: Add a single file to your source code to make it compatible with Rip. In fact, if your source is a single file, you can use it as is. There is no build step and no need to distribute your package via a dedicated system. If your code is on a local file system or on the Web, it’s ready to share.
  • Dependencies are deduced when a Rip package is installed, not when packages run.
  • Software can be installed from a variety of sources, including a directory, a single file, a Git repository, and a traditional gem. A source can be local or remote.
  • You can create one, some, or many virtual environments and switch from one to another with one command. You can also run any Ruby interpreter in concert with Rip, and can run multiple applications concurrently, each in a given environment.

To be clear, Rip isn’t intended to replace RubyGems. Instead, it’s a supplement and an alternative. Rip does not clobber the gems you already have installed, and it won’t upset an existing Ruby or Rails project.

For example, after a fresh install of Rip on a MacBook running Leopard and the latest version of Xcode, the default Rip environment, base, is empty; while all the previously installed gems (upwards of forty) are still available.

$ rip list
ripenv: base
nothing installed

$ gem list
*** LOCAL GEMS ***
abstract (1.0.0)
actionmailer (2.3.2, 2.1.1, 1.3.6, 1.3.3)
actionpack (2.3.2, 2.1.1, 1.13.6, 1.13.3)
actionwebservice (1.2.6, 1.2.3)
activerecord (2.3.2, 2.1.1, 1.15.6, 1.15.3)
activerecord-oracle_enhanced-adapter (1.2.0)
activeresource (2.3.2, 2.1.1)
activesupport (2.3.2, 2.1.1, 1.4.4, 1.4.2)
...
treetop (1.2.4)
vpim (0.658)
ZenTest (4.0.0)

The former command, rip list catalogs all the available packages in the current environment. gem list performs the same function for the local gem repository.

Rip is (currently) user-specific, and each user can have as many environments as desired. However, only one environment may be active at any time.

Rip maintains its enviroments and configuration metadata in $HOME/.rip. Each environment is implemented as a subdirectory. A special subdirectory, aptly named active, contains the software for the active environment. (The active subdirectory is actually a symbolic link to the current environment.)

Assuming you create environments alpha and beta, install some packages in each environment, and make beta the current environment, your Rip directory might look like this:

.rip/
  active -> ~/.rip/beta
  alpha/
    bin/
    lib/
    alpha.ripenv
  base/
    bin/
    lib/
    base.ripenv
  beta/
    bin/
    lib/
    beta.ripenv
  rip-packages/

In each environment, bin contains the applications and utilities installed by the packages stored in the environment, while lib contains code. Each eponymous .ripenv file stores information about the environment, including its contents.

Let ’er Rip

Rip is provided as a traditional Ruby gem and installs in seconds. Type sudo gem install Rip.

$ sudo gem install Rip
Building native extensions.  This could take a while...
****************************************************
So far so good...

Run `rip check` to be sure Rip installed successfully

NOTE: You may need to source your ~/.bashrc
or start a new shell session.

Get started: `rip -h` or http://hellorip.com/

****************************************************
Successfully installed rip-0.0.1
1 gem installed
Installing ri documentation for rip-0.0.1...
Installing RDoc documentation for rip-0.0.1...

Per the message, run rip check to validate the install.

$ rip check
RIPDIR env variable not found. did you run setup.rb?

If you installed the Rip gem and see the error message above, logout and login anew to sources your shell startup files. One of those files sets the environment variables Rip requires to operate.

Comments on "Rip: A New Way to Package Ruby Software"

I savor, lead to I discovered exactly what I used to be taking a look for.
You’ve ended my four day lengthy hunt! Good Bless you
man. Have a nice day. Bye

Here is my web site :: Cheap Car Insurance

Here is a great Blog You may Locate Interesting that we encourage you to visit.

My coder is trying tto convince mee to move to .net from PHP.
I have alwsys disliked the idea because oof the expenses. But he’s tryiong none the less.
I’ve been using WordPress on various websites for about a year
and am concerned about switdhing to another platform. I have heard fantastic things about blogengine.net.
Is there a way I can import all my wordpress posts into it?
Any help would be really appreciated!

Here iss myy site; cheap car insurance

I am actually grateful to the holder of this web
page who has shared this fantastic article at att this place.

Feel free to visit my web site -Cheap car insurance

you’re truly a excellent webmaster. The webb site loading
pacfe is incredible. It seems that youu are doing aany distinctive trick.
In addition, The contents are masterwork. you have performed
a wonderful process on this matter!

Also visit my web site: cheap car insurance for teens

I am regular visitor, how are you everybody? This piece of writing posted at this web site iis genuinely pleasant.

Here is my webpage: Cheap Car Insurance

[url=http://acheterviagrageneriquefrance.com/]viagra generique[/url] viagra
[url=http://viagraachetergenerique.net/]viagra generique[/url] viagra moins cher
[url=http://comprarviagragenericoes.net/]comprar viagra[/url] generico viagra

Definitely believe that which you stated. Your favorite
justification seemed to be on the webb the
simplest thing to be aware of. I say to you, I definitely get irked while people
think about worries that theyy plainly doo not know about.
You managed to hit the nail upon the top as well as defined out the whole
thig without havinjg side-effects , people could take a signal.
Will likely be back to get more. Thanks

Here is my blopg :: Cheap Car Insurance

I know this if off topic but I’m looking into starting
my own blog and was wondering what all iis needed to
get set up? I’m assuming having a blog like yours would cost a pretty penny?

I’m not very internet svvy sso I’m not 100% certain.
Any suggestions or advice would be greatly appreciated.
Cheers

my site: Cheap Car Insurance

Keepp on working, grea job!

My web site cheap car insurance michigan

Excellent post. I used to be checking continuously this weblog and I am impressed!
Very useful information specially the last part :
) I maintain such information a lot. I used to be seeking this
particular info for a long time. Thank you and good luck.

Also visit my site: Car Insurance Companies

If yyou desire to increase your knowledge simply kep visiting this
site and bee updated with the hottest news posted here.

My page cheap car insurance

Do you mind if I quote a few of your articles as long as I provide credit and sources back to your website?

My website is in the very same niche as yours and my users would really benefit
from a lot of the information you present here. Please let me know if this ok with you.
Regards!

Link exchange is nothing else but it is simply placing the other person’s weblog link
on your page at appropriate place and other person will also do same in favor of you.

my page :: cheap car insurance

Incredible story there. What happened after? Take care!

Hello all, here every person is sharing these know-how, thus
it’s nice to read this webpage, and I used to pay a
visit this web site all the time.

my web-site; cheap car insurance

magnificent points altogether, you simply gained a new reader. What may you suggest in regards to your put up that you simply made a few days in the past? Any certain?

Always a huge fan of linking to bloggers that I enjoy but really don’t get a good deal of link really like from.

Wonderful story, reckoned we could combine several unrelated information, nevertheless seriously really worth taking a look, whoa did a single master about Mid East has got much more problerms at the same time.

[url=http://canadianpharcharmyonlineusa.com/]canadian pharcharmy online[/url]
canadian pharcharmy online
http://canadianpharcharmyonlineusa.com/ canadian pharcharmy online

That is the finish of this report. Right here you will come across some web-sites that we feel you?ll enjoy, just click the hyperlinks.

Wonderful story, reckoned we could combine several unrelated information, nonetheless genuinely worth taking a appear, whoa did 1 learn about Mid East has got far more problerms too.

[url=http://acheterviagrageneriquefrance.com/]achat viagra[/url] viagra acheter
[url=http://viagraachetergenerique.net/]viagra sans ordonnance[/url] viagra generique
[url=http://comprarviagragenericoes.net/]viagra generico[/url] comprar viagra por internet

Wow that was strange. I just wrote an incredibly long
comment but after I clicked submit my comment didn’t appear.
Grrrr… well I’m not writing all that over again. Anyhow, just wanted to say wonderful
blog!

Great blog. Will read on…

I think the admin of this site is in fact working hard in support of his web page, as here
every information is quality based material.

Please check out the internet sites we stick to, including this one particular, as it represents our picks in the web.

I simply want to tell you that I am just very new to blogging and site-building and absolutely savored your blog. Almost certainly I’m likely to bookmark your blog . You actually have very good article content. With thanks for sharing with us your webpage.

Leave a Reply