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.
Related
Note: This question relates to How can I get bundler to use the Ruby version set by chruby and .ruby-version?.
Using chruby I have Ruby 1.8.7 installed on macOS:
$ ruby -v
ruby 1.8.7 (2013-06-27 patchlevel 374) [i686-darwin17.4.0]
Also, I have used gem update --system 1.8.30 to install a specific version of RubyGems which I am hoping is compatible. This would appear to be installed properly:
$ gem --version
1.8.30
However, my RubyGems environment shows the incorrect version of Ruby (2.5.0):
$ gem env
RubyGems Environment:
- RUBYGEMS VERSION: 1.8.30
- RUBY VERSION: 2.5.0 (2017-12-25 patchlevel 0) [x86_64-darwin17]
- INSTALLATION DIRECTORY: /Users/keithpitty/.gem/ruby/1.8.7
- RUBY EXECUTABLE: /usr/local/opt/ruby/bin/ruby
- EXECUTABLE DIRECTORY: /Users/keithpitty/.gem/ruby/1.8.7/bin
- RUBYGEMS PLATFORMS:
- ruby
- x86_64-darwin-17
- GEM PATHS:
- /Users/keithpitty/.gem/ruby/1.8.7
- GEM CONFIGURATION:
- :update_sources => true
- :verbose => true
- :benchmark => false
- :backtrace => false
- :bulk_threshold => 1000
- REMOTE SOURCES:
- http://rubygems.org/
How can I fix the RubyGems environment to use the version of Ruby that chruby has set?
My missing step was installing RubyGems 1.6.2 from source. Following advice elsewhere from Dan Cheail, I did the following:
curl -O https://rubygems.org/rubygems/rubygems-1.6.2.tgz
(and then unzipped it)
cd rubygems-1.6.2
chruby ruby-1.8.7-p374
ruby setup.rb
gem update --system 1.8.25
And then my RubyGems environment was fixed:
$ gem env
RubyGems Environment:
- RUBYGEMS VERSION: 1.8.25
- RUBY VERSION: 1.8.7 (2013-06-27 patchlevel 374) [i686-darwin17.4.0]
- INSTALLATION DIRECTORY: /Users/keithpitty/.gem/ruby/1.8.7
- RUBY EXECUTABLE: /Users/keithpitty/.rubies/ruby-1.8.7-p374/bin/ruby
- EXECUTABLE DIRECTORY: /Users/keithpitty/.gem/ruby/1.8.7/bin
- RUBYGEMS PLATFORMS:
- ruby
- x86-darwin-17
- GEM PATHS:
- /Users/keithpitty/.gem/ruby/1.8.7
- /Users/keithpitty/.rubies/ruby-1.8.7-p374/lib/ruby/gems/1.8
- GEM CONFIGURATION:
- :update_sources => true
- :verbose => true
- :benchmark => false
- :backtrace => false
- :bulk_threshold => 1000
- REMOTE SOURCES:
- http://rubygems.org/
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
I am following this guide to install jekyll on OSX 10.7.3 and came up with the problem
ERROR: could not find gem jekyll locally or in a repository
I have tried:
sudo gem update --system (and get Nothing to update)
this post: How can I install Jekyll on Ubuntu 10.04 Server? , and it's no use.
I am not familiar with ruby and gem but I think this is needed:
RubyGems Environment:
- RUBYGEMS VERSION: 1.3.6
- RUBY VERSION: 1.8.7 (2010-01-10 patchlevel 249) [universal-darwin11.0]
- INSTALLATION DIRECTORY: /Library/Ruby/Gems/1.8
- RUBY EXECUTABLE: /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/bin/ruby
- EXECUTABLE DIRECTORY: /usr/bin
- RUBYGEMS PLATFORMS:
- ruby
- universal-darwin-11
- GEM PATHS:
- /Library/Ruby/Gems/1.8
- /Users/enzo/.gem/ruby/1.8
- /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/gems/1.8
- GEM CONFIGURATION:
- :update_sources => true
- :verbose => true
- :benchmark => false
- :backtrace => false
- :bulk_threshold => 1000
- :sources => ["http://rubygems.org", "http://gems.github.com"]
- REMOTE SOURCES:
- http://rubygems.org
- http://gems.github.com
I don't know anything specifically about Jekyll, but there might very well be issues when running it with the system Ruby (that is, the one that comes with Mac OS).
Before wasting too much time bothering with the system Ruby (which could arguably be better left untouched), try to get either rbenv or rvm working. They allow you to install as many different versions of Ruby as you want without messing with the system Ruby, with each installation having its own gems.
Since you're not familiar with Ruby, I'll add that using rbenv or rvm is how most Ruby kids get their job done. Yes, it is an additional step that gets in the way, but it really does facilitate a smoother experience.
I recommend removing gems.github.com from your gem sources unless you really need it. GitHub ceased building gems from git repositories back in 2010. If you cannot remove it, then I recommend installing jekyll with the following command:
gem install --source http://rubygems.org jekyll
My rubygems environment for reference, as I'm on OS X 10.7.5.
RubyGems Environment:
- RUBYGEMS VERSION: 1.3.6
- RUBY VERSION: 1.8.7 (2012-02-08 patchlevel 358) [universal-darwin11.0]
- INSTALLATION DIRECTORY: /Library/Ruby/Gems/1.8
- RUBY EXECUTABLE: /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/bin/ruby
- EXECUTABLE DIRECTORY: /usr/bin
- RUBYGEMS PLATFORMS:
- ruby
- universal-darwin-11
- GEM PATHS:
- /Library/Ruby/Gems/1.8
- /Users/matt/.gem/ruby/1.8
- /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/gems/1.8
- GEM CONFIGURATION:
- :update_sources => true
- :verbose => true
- :benchmark => false
- :backtrace => false
- :bulk_threshold => 1000
- REMOTE SOURCES:
- http://rubygems.org/
I installed Jekyll directly into a new clean install of OSX Mavericks, and then wrote a quick post so I'd remember how to do it after I next reinstall my system. I've had plenty of feedback that others have had success following my guide, and no reports of anyone having any issues:
http://internet-inspired.com/wrote/install-jekyll-in-osx-mavericks/
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.
I'm using Ruby's Command prompt. I cannot install any update, but internet navigation seems to be working.
I have no proxy here.
C:\Windows\System32>gem update activesupport
Updating installed gems
ERROR: While executing gem ... (Gem::RemoteFetcher::FetchError)
SocketError: getaddrinfo: No such host is known. (http://rubygems.org/latest_specs.4.8.gz)
What could be wrong?
Here is my environment:
C:\Ruby\bin>gem env
RubyGems Environment:
- RUBYGEMS VERSION: 1.6.2
- RUBY VERSION: 1.9.2 (2011-02-18 patchlevel 180) [i386-mingw32]
- INSTALLATION DIRECTORY: C:/Ruby/lib/ruby/gems/1.9.1
- RUBY EXECUTABLE: C:/Ruby/bin/ruby.exe
- EXECUTABLE DIRECTORY: C:/Ruby/bin
- RUBYGEMS PLATFORMS:
- ruby
- x86-mingw32
- GEM PATHS:
- C:/Ruby/lib/ruby/gems/1.9.1
- C:/Users/wmj/.gem/ruby/1.9.1
- GEM CONFIGURATION:
- :update_sources => true
- :verbose => true
- :benchmark => false
- :backtrace => false
- :bulk_threshold => 1000
- REMOTE SOURCES:
- http://rubygems.org/
First run (with administrator privileges):
gem update --system
Then run the update for activesupport.
I have that error one time, because i was behind a proxy, in that case, put:
gem update --http-proxy http://web.proxy.uri --system