I've just made the switch from rvm to rbenv and I'm trying to use bundler for gem management. After running bundle install
and trying to run a simple sinatra app (ruby app.rb
), I get this:
Could not find haml-3.1.4 in any of the sources
Run `bundle install` to install missing gems.
Running bundle install
again had no effect. Also tried bundle update
as suggested by another question response.
This is my Gemfile:
source "http://rubygems.org"
gem "sinatra"
gem "haml"
This is what bundle show
produces
* bundler (1.0.22)
* haml (3.1.4)
* rack (1.4.1)
* rack-protection (1.2.0)
* sinatra (1.3.2)
* tilt (1.3.3)
This is what my app requires:
require "rubygems"
require "bundler/setup"
require 'sinatra'
I'm convince that this is some kind of path issue where bundler and rbenv aren't playing along. I've tried looking through rbenv's documentation but was not able to find to anything.
Note: In a different sinatra app I get the following when trying to run it:
Could not find addressable-2.2.7 in any of the sources
Run `bundle install` to install missing gems.
Supplemental info
echo $PATH
/Users/uri/.rbenv/shims:/Users/uri/.rbenv/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/usr/X11/bin
which bundle
/Users/uri/.rbenv/shims/bundle
Update
If I do bundle install --system
it works. Although I can't see this as being a viable solution.
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…