Question

I'm trying to install cocoapods and do the setup for my ios project.

However, after I install with the following command:

$ sudo gem install cocoapods

I tried to run the command below but it gives "command not found" error.

$ pod setup

I was using rvm long time ago with my ruby project, so I also updated the version of rvm.

I also searched the install location with this command:

find /usr -name "pod"

and here are the locations for cocoapods files:

/usr/local/rvm/rubies/rbx-head/gems/1.8/bin/pod
/usr/local/rvm/rubies/rbx-head/gems/1.8/gems/cocoapods-0.32.1/bin/pod
/usr/local/rvm/rubies/rbx-head/gems/1.8/gems/cocoapods-try-0.2.0/lib/pod

But in my .bash_profile I have the following line:

[[ -s  "$HOME/.rvm/scripts/rvm" ]] && source "$HOME/.rvm/scripts/rvm"  # This loads RVM into a shell session.

I tried almost every suggestions from either stackoverflow or any other website but I couldn't manage to setup it.

That would be great if you can help me.

Thanks!

Was it helpful?

Solution

After couple of hours, I finally overcame the issue.

In my opinion that problem occurs when we have different path and different versions of ruby.

I wasn't using mac's own ruby. (You can check it by writing "which ruby" to your console, the result should be "/usr/bin/ruby" if you haven't defined any other path.)

Hence I removed all of the ruby versions from my rvm.

After that, I also deleted the below line from my .bash_profile file.

[[ -s  "$HOME/.rvm/scripts/rvm" ]] && source "$HOME/.rvm/scripts/rvm"  # This loads RVM into a shell session.

I hope it will help you as well.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top