Skip to content
forked from rbenv/rbenv-vars

An rbenv plugin that safely sets global and per-project environment variables

License

Notifications You must be signed in to change notification settings

kalin/rbenv-vars

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 

Repository files navigation

rbenv-vars

This is a plugin for rbenv that lets you set global and project-specific environment variables before spawning Ruby processes.

Installation

To install rbenv-vars, clone this repository into your ~/.rbenv/plugins directory. (You'll need a recent version of rbenv that supports plugin bundles.)

$ mkdir -p ~/.rbenv/plugins
$ cd ~/.rbenv/plugins
$ git clone https://github.com/sstephenson/rbenv-vars.git

Usage

Define environment variables in an .rbenv-vars file in your project, one variable per line, in the format VAR=value. For example:

RUBY_GC_MALLOC_LIMIT=50000000
RUBY_HEAP_MIN_SLOTS=15000
RUBY_FREE_MIN=4096

You can perform variable substitution with the traditional $ syntax. For example, to append to GEM_PATH:

GEM_PATH=$GEM_PATH:/u/shared/gems

Spaces are allowed in values; quoting is not necessary. Expansion and command substitution are not allowed. Lines beginning with # or any lines not in the format VAR=value will be ignored.

Variables specified in the ~/.rbenv/vars file will be set first. Then current version specific variables in ~/.rbenv/versions/versionname/vars. Then variables specified in .rbenv-vars files in any parent directories of the current directory will be set. Variables from the .rbenv-vars file in the current directory are set last.

Use the rbenv vars command to print all environment variables in the order they'll be set.

License

© 2011 Sam Stephenson. Released under the MIT license. See LICENSE for details.

About

An rbenv plugin that safely sets global and per-project environment variables

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Shell 100.0%