10
10

More than 5 years have passed since last update.

【メモ】rbenv, bundlerトラブル

Posted at

現象

rbenv入れているのにbundle installするとシステムのrubyのgemディレクトリにインストールしようとする

-> % bundle install
Fetching gem metadata from https://rubygems.org/.........
Fetching gem metadata from https://rubygems.org/..
Installing rake (10.1.1)
Errno::EACCES: Permission denied - /Library/Ruby/Gems/2.0.0/build_info/rake-10.1.1.info
An error occurred while installing rake (10.1.1), and Bundler cannot continue.
Make sure that `gem install rake -v '10.1.1'` succeeds before bundling.
-> % rbenv versions
  system
* 2.0.0-p353 (set by /usr/local/opt/rbenv/version)

本当は2.0.0-p353の方に入れたい

原因

bundlerのインストール漏れ

-> % which bundle
/usr/bin/bundle

↑システムのbundlerだった。
ので、2.0.0-p353にもbundlerを入れる

-> % gem install bundler
Fetching: bundler-1.5.2.gem (100%)
Successfully installed bundler-1.5.2
1 gem installed
-> % rbenv rehash
-> % which bundler
/usr/local/opt/rbenv/shims/bundler

これでインストールが出来るようになった

-> % bundle install
Fetching gem metadata from https://rubygems.org/.........
Fetching additional metadata from https://rubygems.org/..
Using rake (10.1.1)
Using i18n (0.6.9)
Using multi_json (1.8.4)
Installing activesupport (3.2.16)
Installing builder (3.0.0)
...
Your bundle is complete!
...
10
10
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
10
10