4
votes

I'm currently trying to run 'bundle install' to install a git based gem using a Gemfile and consequently use ruby/ other ruby commands without bundler with the latest version of RVM (1.14.3).

I believe the cause of the issue is that bundler is installing the git gem into .rvm/gems/ruby-1.9.3-p194@something/bundler/gems while all other gems are installed into .rvm/gems/ruby-1.9.3-p194@something/gems. As a result, 'bundle list' shows the gem but 'gem list' does not.

Any thoughts here? I'd really prefer not to use bundle to execute everything.

1

1 Answers

6
votes

Bundler is for bundling gems with applications. It doesn't make sense to use it for system gems. Unfortunately, the non-bundler gem system offers no direct way to install git-based gems (I actually asked a question about this previously, see Is it possible to directly install a gem from a git repository?). Instead, you have to do it manually in three steps:

  1. Clone the gem repo (this is assuming a github repository, but it will work for a repository hosted anywhere, just substitute the right git repo location).

    git clone git://github.com/user/gem.git
    
  2. Go to the cloned gem repo directory and build the gem (this will also check for dependencies and warn you if the install failed because of a missing dependency -- in that case just install the dependencies and try again).

    rake gem
    

    Or if that doesn't work:

    gem build gem.gemspec
    
  3. This should have created a file with a name like pkg/gem-1.2.3.gem (sometimes it will build in the pkg directory like this, sometimes it will build in the gem repo root directory). You can now install it.

    gem install pkg/gem-1.2.3.gem