Code Monkey home page Code Monkey logo

gemenv's Introduction

gemenv

A tool for managing gem environments.

Introduction

gemenv is a tool to build rubygem environments, in the spirit of Python's virtualenv. It creates a directory with a complete GEM_HOME to contain all of your project's gems. It also contains an activation script to enable this environment, and an executor to run subshells (or anything else) with the right environment variables set.

Here's an example session:

$ cd /tmp
$ gemenv my-new-env
$ ls my-new-env
bin/ gem_home
$ source my-new-env/bin/activate
$ gem install rake
Fetching: rake-10.0.3.gem (100%)
Successfully installed rake-10.0.3
1 gem installed
Installing ri documentation for rake-10.0.3...
Installing RDoc documentation for rake-10.0.3...
{gemenv:my-new-env}
$ ls my-new-env/gem_home/gems
rake-10.0.3
$ which rake
/tmp/my-new-env/gem_home/bin/rake
$ echo $VIRTUAL_ENV
/tmp/my-new-env

You can see that sourcing the activate script does three things:

  1. It sets GEM_HOME so that gem installations go into the environment, not your home or system GEM_HOME
  2. It adds the GEM_HOME bin/ directory to your $PATH so that gem-installed binaries are available.
  3. It adds a VIRTUAL_ENV environment variable that you can strap into PS1 if you wish.

This is (almost) all it does. There is currently no way to deactivate a gemenv environment activated by bin/activate. If you want a deactivatable environment, use bin/exec:

$ my-new-env/bin/exec /bin/bash

Anything which respects GEM_HOME should work with gemenv, so you can, for instance, use bundler to install gems into a gemenv.

The activation script currently overwrites GEM_PATH, so gemenv does not currently support "global" gems.

-- Alex Young [email protected]

gemenv's People

Contributors

bmalex avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.