Giter Club home page Giter Club logo

rbenv-bundler-ruby-version's Introduction

rbenv-bundler-ruby-version

Plugin for rbenv to use a ruby version from bundler's Gemfile. If a custom Ruby version is not already set locally per-directory (like in .ruby-version), this looks for a Ruby version in the current tree's Gemfile and uses that version.

Requirements: rbenv 1.0.0 or higher

Build Status

Installation

  • Check the plugin out into your rbenv plugins directory:

    git clone https://github.com/aripollak/rbenv-bundler-ruby-version.git \
        "$(rbenv root)"/plugins/rbenv-bundler-ruby-version
  • Not needed starting from Ruby 2.1: If you don't already have a symlink in "$(rbenv root)"/versions from your latest Ruby patchlevel (2.0.0-p247) to the base version (2.0.0), now would be a good time to do that. You can install rbenv-aliases to make this easier. Once you have rbenv-aliases installed: run:

    rbenv alias --auto
  • That's it! Now ruby, gem, and your other rbenv shims should automatically find the correct Ruby version.

Caveats

The logic currently used to find the version is simplistic; rbenv-bundler-ruby-version supports:

  • simple ruby '2.0.0'
  • lines with engines, like:
    • ruby '2.0.0', engine: 'jruby', engine_version: '1.7.8'
    • ruby "2.0.0", :engine_version => "1.7.8", :engine => 'jruby'
  • comments at the end of line (just strips them)

The parsing is done with regular expressions, i.e. no ruby evaluation is done. So expressions and conditionals are NOT handled and anything else is not handled. Prepend true && to the ruby line if you are doing such and want to hide it from this plugin.

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.