Skip to content

Instantly share code, notes, and snippets.

@imaz
Created November 8, 2012 04:26
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save imaz/4036786 to your computer and use it in GitHub Desktop.
Save imaz/4036786 to your computer and use it in GitHub Desktop.
rbenv に変更した後 bundle install できない件
rvmを削除してrbenv+ruby-buildに変更して1.9.3-p194をビルドしましたが、Gemfileのなかの
gem 'turn', require: false
こういうハッシュでエラーが出ます。どうしたら良いでしょうか!?
[~/work/Rails/Gettan]$ ruby -v
ruby 1.9.3p194 (2012-04-20 revision 35410) [x86_64-darwin12.2.0]
[~/work/Rails/Gettan]$ rbenv version
1.9.3-p194 (set by /Users/imaz/.rbenv/version)
[~/work/Rails/Gettan]$ which gem
/Users/imaz/.rbenv/shims/gem
[~/work/Rails/Gettan]$ which bundle
/usr/bin/bundle
[~/work/Rails/Gettan]$ bundle install
/Users/imaz/work/Rails/Gettan/Gemfile:44:in `evaluate': compile error (SyntaxError)
/Users/imaz/work/Rails/Gettan/Gemfile:35: syntax error, unexpected ':', expecting kEND
gem 'turn', require: false
^
from /Library/Ruby/Gems/1.8/gems/bundler-1.0.15/lib/bundler/definition.rb:17:in `build'
from /Library/Ruby/Gems/1.8/gems/bundler-1.0.15/lib/bundler.rb:136:in `definition'
from /Library/Ruby/Gems/1.8/gems/bundler-1.0.15/lib/bundler/cli.rb:222:in `install'
from /Library/Ruby/Gems/1.8/gems/bundler-1.0.15/lib/bundler/vendor/thor/task.rb:22:in `send'
from /Library/Ruby/Gems/1.8/gems/bundler-1.0.15/lib/bundler/vendor/thor/task.rb:22:in `run'
from /Library/Ruby/Gems/1.8/gems/bundler-1.0.15/lib/bundler/vendor/thor/invocation.rb:118:in `invoke_task'
from /Library/Ruby/Gems/1.8/gems/bundler-1.0.15/lib/bundler/vendor/thor.rb:246:in `dispatch'
from /Library/Ruby/Gems/1.8/gems/bundler-1.0.15/lib/bundler/vendor/thor/base.rb:389:in `start'
from /Library/Ruby/Gems/1.8/gems/bundler-1.0.15/bin/bundle:13
from /usr/bin/bundle:19:in `load'
from /usr/bin/bundle:19
@tricknotes
Copy link

まず、 ruby 1.9.3 の bundler が使われてないように見えます。
次のコマンドで ruby 1.9.3 に bundelr をインストールしてみてください。

$ gem install bundler
$ rbenv rehash

その後、bundler のパスがどこになっているか確認してもらえますかー?

$ which bundle

(/Users/imaz/.rbenv/shims/bundle とかだと work しそう)

@tricknotes
Copy link

あ、あとは PATH の解決順序の問題もあるので、which bundle の結果が上のようになっても上手くいかない場合は、

$ echo $PATH

とかで PATH の順番を確認してもらえるとよいかもです!

@imaz
Copy link
Author

imaz commented Nov 8, 2012

$ gem install bundler
Fetching: bundler-1.2.1.gem (100%)
Successfully installed bundler-1.2.1
1 gem installed
Installing ri documentation for bundler-1.2.1...
Installing RDoc documentation for bundler-1.2.1...
$ rbenv rehash
$ which bundle
/Users/imaz/.rbenv/shims/bundle

こうなりました! しかし、エラーメッセージは変わらないです...><

@imaz
Copy link
Author

imaz commented Nov 8, 2012

$ echo $PATH
/Users/imaz/.rbenv/shims:/Users/imaz/.rbenv/bin:/usr/local/bin:/Users/imaz/.rbenv/shims:/usr/local/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/opt/X11/bin:/Users/imaz/.rbenv/bin

PATHはこんな感じで、.bashrcのPATH設定とrbenvの設定はこんな感じです!

 PATH=/usr/local/bin:$PATH
 PATH=$HOME/.rbenv/bin:$PATH
 eval "$(rbenv init -)"

@imaz
Copy link
Author

imaz commented Nov 8, 2012

PATH=$HOME/.rbenv/bin:$PATH
PATH=/usr/local/bin:$PATH
eval "$(rbenv init -)"

こう変更したらいけましたー!
ありがとうございます!:joy:

@tricknotes
Copy link

惚れさせ715 「えっ じゃあ聞く?」 俺が社員のミスを フォローした話って聞いてる?

@imaz
Copy link
Author

imaz commented Nov 8, 2012

惚れさせ563 「その話ですか~」 あ〜 はいはい あ〜〜 はいはいはいはい

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment