Some days ago, I updated my Macbook Pro’s OS to 10.10, then I changed the default Ruby version to other verson rather than the system default version. Today, when I used the pod install
to install some third libraries, I found the followed error:
1 | -bash: /usr/local/bin/pod: /usr/local/Cellar/ruby/2.1.2_3/bin/ruby: bad interpreter: No such file or directory |
Then I knew that the pod command used wrong ruby version.
Try many ways, but I still can’t solve it. Then I opened the cocoaPods Guides and found the followed text:
CocoaPods is built with Ruby and it will be installable with the default Ruby available on OS X. You can use a Ruby Version manager, however we recommend that you use the standard Ruby available on OS X unless you know what you're doing.
Ok, I am sorry for seeing the text too late. But now, how should I do? I have no idea. Maybe I can see what it is in the pod file.
Then I run which pod
on the terminal.
1 | shunzhu:~ vale$ which pod |
Then run mate /usr/local/bin/pod
:
1 | #!/usr/local/Cellar/ruby/2.1.2_3/bin/ruby |
Maybe I find something, the code in the first line, it is very similar with the error hint:
1 | -bash: /usr/local/bin/pod: /usr/local/Cellar/ruby/2.1.2_3/bin/ruby: bad interpreter: No such file or directory |
Ok, let me change the first line code to this #!/usr/bin/ruby
Try pod
again:
1 | shunzhu:~ vale$ pod |
Until here, I think I have solved the issue. Thanks God!!!