Created
November 8, 2012 04:26
-
-
Save imaz/4036786 to your computer and use it in GitHub Desktop.
rbenv に変更した後 bundle install できない件
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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 |
あ、あとは PATH の解決順序の問題もあるので、which bundle の結果が上のようになっても上手くいかない場合は、
$ echo $PATHとかで PATH の順番を確認してもらえるとよいかもです!
Author
$ 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こうなりました! しかし、エラーメッセージは変わらないです...><
Author
$ 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/binPATHはこんな感じで、.bashrcのPATH設定とrbenvの設定はこんな感じです!
PATH=/usr/local/bin:$PATH
PATH=$HOME/.rbenv/bin:$PATH
eval "$(rbenv init -)"
Author
PATH=$HOME/.rbenv/bin:$PATH
PATH=/usr/local/bin:$PATH
eval "$(rbenv init -)"こう変更したらいけましたー!
ありがとうございます!:joy:
Author
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment


まず、 ruby 1.9.3 の bundler が使われてないように見えます。
次のコマンドで ruby 1.9.3 に bundelr をインストールしてみてください。
その後、bundler のパスがどこになっているか確認してもらえますかー?
(
/Users/imaz/.rbenv/shims/bundleとかだと work しそう)