I'm trying to install cocoapods on Mac
Successfully installed cocoapods-0.25.0
1 gem installed
But
$ pod install
-bash: pod: command not found
Ruby was installed using brew
$ which ruby
/usr/local/bin/ruby
$ which gem
/usr/local/bin/gem
Here is output of gem environment
$ gem environment
RubyGems Environment:
- RUBYGEMS VERSION: 2.0.3
- RUBY VERSION: 2.0.0 (2013-06-27 patchlevel 247) [x86_64-darwin12.5.0]
- INSTALLATION DIRECTORY: /usr/local/Cellar/ruby/2.0.0-p247/lib/ruby/gems/2.0.0
- RUBY EXECUTABLE: /usr/local/Cellar/ruby/2.0.0-p247/bin/ruby
- EXECUTABLE DIRECTORY: /usr/local/Cellar/ruby/2.0.0-p247/bin
- RUBYGEMS PLATFORMS:
- ruby
- x86_64-darwin-12
- GEM PATHS:
- /usr/local/Cellar/ruby/2.0.0-p247/lib/ruby/gems/2.0.0
- /Users/nt/.gem/ruby/2.0.0
- GEM CONFIGURATION:
- :update_sources => true
- :verbose => true
- :backtrace => false
- :bulk_threshold => 1000
- "install" => "--no-rdoc --no-ri"
- "update" => "--no-rdoc --no-ri"
- REMOTE SOURCES:
- https://rubygems.org/
What I should export or add to .bash_profile to get pod install working?
If you are using rbenv like I am, after installing a gem you have to run rbenv rehash to get a link in the shims directory.
My bad, this line in .bash_profile helped
export PATH=$PATH:/usr/local/Cellar/ruby/2.0.0-p247/bin
Related
I'm pretty new to Ruby and pod installation. Currently I have Ruby installed through RVM. However I'd like to install a pod through bundler by bundle exec pod install.
I keep getting the following error that my current version of Ruby is different from Gemfile specified. My current version of Ruby via RVM is same with Gemfile version. (So if I do pod install it won't cause any issues).
My gem env shows different Ruby Version.
How can I go about changing that? Where does gem env live? I saw some instructions here to install a RubyGem. But I'm having trouble following this. Any advice helps!
➜ ios git:(main) bundle exec pod install
Your Ruby version is 2.6.8, but your Gemfile specified 2.7.5
➜ ios git:(main) gem env
RubyGems Environment:
- RUBYGEMS VERSION: 3.0.3.1
- RUBY VERSION: 2.6.8 (2021-07-07 patchlevel 205) [universal.x86_64-darwin21]
- INSTALLATION DIRECTORY: /Users/myusername/.gem
- USER INSTALLATION DIRECTORY: /Users/myusername/.gem/ruby/2.6.0
- RUBY EXECUTABLE: /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/bin/ruby
- GIT EXECUTABLE: /usr/local/bin/git
- EXECUTABLE DIRECTORY: /Users/myusername/.gem/bin
- SPEC CACHE DIRECTORY: /Users/myusername/.gem/specs
- SYSTEM CONFIGURATION DIRECTORY: /Library/Ruby/Site
- RUBYGEMS PLATFORMS:
- ruby
- universal-darwin-21
- GEM PATHS:
- /Users/myusername/.gem
- /Users/myusername/.gem/ruby/2.6.0
- /Library/Ruby/Gems/2.6.0
- /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/gems/2.6.0
- GEM CONFIGURATION:
- :update_sources => true
- :verbose => true
- :backtrace => false
- :bulk_threshold => 1000
- REMOTE SOURCES:
- https://rubygems.org/
Centos 7
I have installed ruby 2.1.2 and rubygems but when I run rubygems --version I get the error rubygems: command not found.
My $PATH is /usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin:/usr/local/lib/ruby/gems/2.1.0:/root/.gem/ruby/2.1.0
gem environment
RubyGems Environment:
- RUBYGEMS VERSION: 2.6.11
- RUBY VERSION: 2.1.2 (2014-05-08 patchlevel 95) [x86_64-linux]
- INSTALLATION DIRECTORY: /usr/local/lib/ruby/gems/2.1.0
- USER INSTALLATION DIRECTORY: /root/.gem/ruby/2.1.0
- RUBY EXECUTABLE: /usr/local/bin/ruby
- EXECUTABLE DIRECTORY: /usr/local/bin
- SPEC CACHE DIRECTORY: /root/.gem/specs
- SYSTEM CONFIGURATION DIRECTORY: /usr/local/etc
- RUBYGEMS PLATFORMS:
- ruby
- x86_64-linux
- GEM PATHS:
- /usr/local/lib/ruby/gems/2.1.0
- /root/.gem/ruby/2.1.0
- GEM CONFIGURATION:
- :update_sources => true
- :verbose => true
- :backtrace => false
- :bulk_threshold => 1000
- REMOTE SOURCES:
- https://rubygems.org/
- SHELL PATH:
- /usr/local/sbin
- /usr/local/bin
- /sbin
- /bin
- /usr/sbin
- /usr/bin
- /root/bin
- /root/ruby-2.1.2
- /usr/bin/gem
yum list installed shows rubygems.noarch
What do I need to do to get rubygems working?
To install ruby and rubygems on centOS, Run on Terminal
sudo yum install ruby
sudo yum install rubygems
To check version of of ruby and rubygems, Run
ruby -v
gem -v
Note: gem --version is same as gem -v
Update the gems list using :
sudo gem update
sudo gem update --system
Now, you can install any gem, using command
gem install <gem_name>
For instance, To install rails on centOS, Run
sudo gem install rails
This is my .gemrc
:verbose: true
I have copied the same .gemrc into /root/ and into /home/vagrant/, to make sure that using sudo isn't messing with me.
I have checked the setting is working with:
root#vagrant $ gem env
RubyGems Environment:
- RUBYGEMS VERSION: 1.8.23
- RUBY VERSION: 1.9.3 (2013-11-22 patchlevel 484) [x86_64-linux]
- INSTALLATION DIRECTORY: /var/lib/gems/1.9.1
- RUBY EXECUTABLE: /usr/bin/ruby1.9.1
- EXECUTABLE DIRECTORY: /usr/local/bin
- RUBYGEMS PLATFORMS:
- ruby
- x86_64-linux
- GEM PATHS:
- /var/lib/gems/1.9.1
- /root/.gem/ruby/1.9.1
- GEM CONFIGURATION:
- :update_sources => true
- :verbose => true
- :benchmark => false
- :backtrace => false
- :bulk_threshold => 1000
- REMOTE SOURCES:
- http://rubygems.org/
The problem is that that when I execute:
root#vagrant $ gem install knife-solo
I get a "less verbose" output than when I execute:
root#vagrant $ gem install knife-solo --verbose
even though the .gemrc file sets the verbose as true.
What am I missing?
To set the --verbose or --no-verbose option for the gem command, add the command to the gem key in ~/.gemrc:
gem: --no-ri --no-rdoc --verbose
I can't install gems with bundler, it always fail with a Can't find <inser-gem-name-here> in any of the sources message although I do have rubygems defined as a source in my gemfile.
Also, I can normally install gems with gem install <gem-name>, I used to install the ones that fail manually and then run bundle install so that it sees them as already installed, but that doesn't wrok anymore.
I used to use rvm, got tired of this issue (and thought it caused it) so I switched to rbenv to no avail. I'm running 1.9.2-p290.
I'm running Mac OS Lion. Thanks!
gem env output:
RubyGems Environment:
- RUBYGEMS VERSION: 1.8.10
- RUBY VERSION: 1.9.2 (2011-07-09 patchlevel 290) [x86_64-darwin11.2.0]
- INSTALLATION DIRECTORY: /Users/X/.rbenv/versions/1.9.2-p290/lib/ruby/gems/1.9.1
- RUBY EXECUTABLE: /Users/X/.rbenv/versions/1.9.2-p290/bin/ruby
- EXECUTABLE DIRECTORY: /Users/X/.rbenv/versions/1.9.2-p290/bin
- RUBYGEMS PLATFORMS:
- ruby
- x86_64-darwin-11
- GEM PATHS:
- /Users/X/.rbenv/versions/1.9.2-p290/lib/ruby/gems/1.9.1
- /Users/X/.gem/ruby/1.9.1
- GEM CONFIGURATION:
- :update_sources => true
- :verbose => true
- :benchmark => false
- :backtrace => false
- :bulk_threshold => 1000
- :sources => ["http://gems.github.com", "http://rubygems.org", "http://gemcutter.org"]
- REMOTE SOURCES:
- http://gems.github.com
- http://rubygems.org
- http://gemcutter.org
Also
$which gem
/Users/X/.rbenv/shims/gem
And
$ which ruby
/Users/X/.rbenv/shims/ruby
I had a similar problem, that I managed to resolve by exporting my http_proxy
export http_proxy=http://user:password#host:port
Hope this helps.
The definitive guide to installing Jekyll seems to be https://github.com/jekyll/jekyll where it says:
gem install jekyll
I am getting an
ERROR: could not find gem jekyll locally or in a repository
regardless of whether I run that command as superuser or not.
gem env Returns the following:
RubyGems Environment:
- RUBYGEMS VERSION: 1.2.0
- RUBY VERSION: 1.8.7 (2008-08-11 patchlevel 72) [i486-linux]
- INSTALLATION DIRECTORY: /var/lib/gems/1.8
- RUBY EXECUTABLE: /usr/bin/ruby1.8
- EXECUTABLE DIRECTORY: /var/lib/gems/1.8/bin
- RUBYGEMS PLATFORMS:
- ruby
- x86-linux
- GEM PATHS:
- /var/lib/gems/1.8
- GEM CONFIGURATION:
- :update_sources => true
- :verbose => true
- :benchmark => false
- :backtrace => false
- :bulk_threshold => 1000
- :sources => ["http://gems.github.com/", "http://gems.rubyforge.org/"]
- REMOTE SOURCES:
- http://gems.github.com/
- http://gems.rubyforge.org/
I have also tried specifying github as the source with no luck. What else should I be trying?
You are using a very outdated version of RubyGems.
First, update the sources:
$ gem sources --clear-all
$ gem sources --add http://rubygems.org
$ gem sources --add http://gems.github.com
Then try to install it.
You should also login as a superuser and update the RubyGems version.
The current release is 1.3.7.