I'm having difficulties updating RubyGems from version 1.1.1 to newest. I've tried the following:
gem update
Result:
Updating installed gems
Bulk updating Gem source index for: http://gems.rubyforge.org/
Nothing to update
and
gem install rubygems-update
Result:
Bulk updating Gem source index for: http://gems.rubyforge.org/
Bulk updating Gem source index for: http://gems.rubyforge.org/
ERROR: Error installing rubygems-update:
rubygems-update requires builder (>= 0)
and
gem install rubygems-update update_rubygems
Result:
Bulk updating Gem source index for: http://gems.rubyforge.org/
Bulk updating Gem source index for: http://gems.rubyforge.org/
ERROR: Error installing rubygems-update:
rubygems-update requires builder (>= 0)
ERROR: could not find update_rubygems locally or in a repository
Then I checked, as suggested by theIV on a similar question, whether I had http://gems.rubyforge.org/ in my remote sources. Here's the gems environment:
RubyGems Environment:
- RUBYGEMS VERSION: 1.1.1
- RUBY VERSION: 1.8.6 (2008-08-11 patchlevel 287) [universal-darwin9.0]
- INSTALLATION DIRECTORY: /Library/Ruby/Gems/1.8
- RUBY EXECUTABLE: /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/bin/ruby
- RUBYGEMS PLATFORMS:
- ruby
- universal-darwin-9
- GEM PATHS:
- /Library/Ruby/Gems/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://gems.rubyforge.org
So, yeah, any ideas?
There is no need to take such drastic steps as completely rebuilding Ruby, reinstalling Rubygems from scratch or installing a version manager to solve this problem. There is simply a dependency cycle introduced by the release of hoe 2.3.0:
rubygems-update 1.3.5 requires (among other things) hoe-seattlerb
hoe-seattlerb requires hoe >= 2.3.0
hoe >= 2.3.0 requires rubygems >= 1.3.1
I wrote the blog post linked to by zipizap. To recap:
If you've already tried to update, uninstall the latest rubygems-update first: sudo gem uninstall rubygems-update -v 1.3.5
Update to 1.3.0: sudo gem install rubygems-update -v 1.3.0
sudo update_rubygems
Then update to latest: sudo gem update --system
With the release of Rubygems 1.3.6, it looks like this problem may be gone. From the release notes:
Development deps are no longer added to rubygems-update gem so older
versions can update sucessfully.
Oi - I feel your pain. I'll first ask the obvious; Have you been executing the commands with sudo? So you'll use sudo gem install rubygems-update and sudo update_rubygems.
If that doesn't work, download gems source again and rebuild from scratch (may want to erase prior source download, etc). You may want to read HiveLogic article on installing Ruby, RubyGems, etc on Mac OS Snow Leopard.
If that doesnt' work... :) I might do the drastic and rebuild Ruby as well.
Similar problem, different solution
$ sudo gem install rubygems-update update_rubygems
Updating metadata for 1 gems from gems.rubyforge.org/
.
complete
ERROR: Error installing rubygems-update:
rubygems-update requires builder (>= 0)
ERROR: could not find update_rubygems locally or in a repository
and
$ sudo gem update --system
ERROR: While executing gem ... (RuntimeError)
gem update --system is disabled on Debian. RubyGems can be updated using the official Debian repositories by aptitude or apt-get.
My solution:
Go to http://docs.rubygems.org/read/chapter/3#page13
and install manually, i.e. get the rubygems.... tgz and install it.
Hope it helps someone.
Any luck with gem install builder? That looks to be what you need to get rubygems-update to install.
I ran into a similar issue, and I was able to upgrade by doing this:
sudo gem update --system
The problem seems to be detected and reported as a dependecy-cycle: some new-version-dependencies are needed in order to install the new-gems-version... yes, it is a mess.The recomended solution I've seen is to make the upgrade in a step-by-step intermediate version fashion, in order to make the upgrade transition smooth, with small version-gaps.
Read it in this article, which explains it very well:
link text
After reading it and trying a couple of times, I've seen that it was still very fuzzy/complicated.
So I went for another solution, which installs more then necesary but is more straighforward:
Install a more recent version of ruby + irb + rdoc + gem (side by side with old version already existing)
Now install the gem "Ruby Version Manager" (a no pain in debian/ubuntu, it can compile latest ruby version) link text
Use RVM to install the final and latest ruby version (side-by-side again) and maintain it updated.
(you could now use RVM to uninstall the older versions of ruby/gems in your system, and only keept the latest ruby version)
If you need it for a production system, RVM is already seen as mature enough to maintain ruby/gems updated with newer versions.
Hope it helps some starter like me to "get toubles out of the way"
NOTE: RubyGems 1.1 and 1.2 have problems upgrading when there is no rubygems-update installed. You will need to use the following instructions if you see Nothing to update. If you have an older version of RubyGems installed, then you can still do it in two steps:
$ gem install rubygems-update # again, might need to be admin/root
$ update_rubygems # ... here too
Re-build it from the sources.
Related
The bounty expires tomorrow. Answers to this question are eligible for a +100 reputation bounty.
Kadaj13 wants to draw more attention to this question.
I am trying to make my personal website using github and jekyll following the instructions on the official website
When I reach the part:
jekyll new --skip-bundle
I received:
can't find gem jekyll (>= 0.a) with executable jekyll (Gem::GemNotFoundException)
I tried several approaches, such as the one mentioned here and I ran the command with sudo. Again after running jekyll new --skip-bundle .
Here is the terminal response after installing with instructions here
Fetching bundler-2.4.5.gem
Successfully installed bundler-2.4.5
Parsing documentation for bundler-2.4.5
Installing ri documentation for bundler-2.4.5
Done installing documentation for bundler after 0 seconds
1 gem installed
And here is the terminal response when I run jekyll new --skip-bundle again:
Traceback (most recent call last):
2: from /usr/local/bin/jekyll:22:in `<main>'
1: from /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/rubygems.rb:262:in `bin_path'
/System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/rubygems.rb:283:in `find_spec_for_exe': can't find gem jekyll (>= 0.a) with executable jekyll (Gem::GemNotFoundException)
I appreciate if you can help me how to solve it.
I use macOs.
Update:
I run bundle add jekyll and I received:
Your RubyGems version (3.0.3) has a bug that prevents `required_ruby_version` from working for Bundler. Any scripts that use `gem install bundler` will break as soon as Bundler drops support for your Ruby version. Please upgrade RubyGems to avoid future breakage and silence this warning by running `gem update --system 3.2.3
Could not locate Gemfile`
Then I run gem update --system 3.2.3
Updating rubygems-update
Fetching rubygems-update-3.2.3.gem
ERROR: While executing gem ... (Gem::FilePermissionError)
You don't have write permissions for the /Library/Ruby/Gems/2.6.0 directory.
Next step I run sudo gem update --system 3.2.3 and I received:
Updating rubygems-update
Fetching rubygems-update-3.2.3.gem
Successfully installed rubygems-update-3.2.3
Parsing documentation for rubygems-update-3.2.3
Installing ri documentation for rubygems-update-3.2.3
Installing darkfish documentation for rubygems-update-3.2.3
Done installing documentation for rubygems-update after 78 seconds
Parsing documentation for rubygems-update-3.2.3
Done installing documentation for rubygems-update after 0 seconds
Installing RubyGems 3.2.3
ERROR: While executing gem ... (Errno::EROFS)
Read-only file system # rb_sysopen - /usr/share/man/man1/bundle-platform.1
So still I failed to add jekyll....
System information:
Ruby: ruby 2.6.3p62 (2019-04-16 revision 67580) [universal.x86_64-darwin19]
Gem: 3.2.3
Bundler: version 2.4.6
Homebrew:
Homebrew 3.6.20
Homebrew/homebrew-core (git revision fc36a19edf4; last commit 2023-02-04)
Homebrew/homebrew-cask (git revision 4c5d3e2391; last commit 2023-02-04)
CPU: Darwin Kernel Version 19.6.0: Mon Aug 31 22:12:52 PDT 2020; root:xnu-6153.141.2~1/RELEASE_X86_64
Update 2:
Should I run these commands where my gem files are located?
I run gem environment and here is what I received. In which directory should I run these commands?
RubyGems Environment:
- RUBYGEMS VERSION: 3.2.3
- RUBY VERSION: 2.6.3 (2019-04-16 patchlevel 62) [universal.x86_64-darwin19]
- INSTALLATION DIRECTORY: /Library/Ruby/Gems/2.6.0
- USER INSTALLATION DIRECTORY: /Users/shirinvafaei/.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: /usr/bin
- SPEC CACHE DIRECTORY: /Users/shirinvafaei/.gem/specs
- SYSTEM CONFIGURATION DIRECTORY: /Library/Ruby/Site
- RUBYGEMS PLATFORMS:
- ruby
- universal-darwin-19
- GEM PATHS:
- /Library/Ruby/Gems/2.6.0
- /Users/shirinvafaei/.gem/ruby/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/
- SHELL PATH:
- /Users/shirinvafaei/.rbenv/shims
- /Users/shirinvafaei/.rbenv/bin
- /usr/local/Cellar/ruby/2.4.1_1/bin
- /usr/local/bin
- /Users/shirinvafaei/opt/anaconda3/bin
- /Users/shirinvafaei/opt/anaconda3/condabin
- /Library/Frameworks/Python.framework/Versions/2.7/bin
- /Library/Frameworks/Python.framework/Versions/3.8/bin
- /usr/local/bin
- /usr/bin
- /bin
- /usr/sbin
- /sbin
- /opt/X11/bin
Another update:
I tried
rben install 3.0.5
and I received this error message:
eb322180c6f18a6f74e4b6aa
Installing openssl-1.1.1s...
BUILD FAILED (Mac OS X 10.15.7 using ruby-build 20230202)
Inspect or clean up the working tree at /var/folders/yk/clm8vmf15r9cv4hghy2wm6380000gn/T/ruby-build.20230215141911.2345.jn3ObC
Results logged to /var/folders/yk/clm8vmf15r9cv4hghy2wm6380000gn/T/ruby-build.20230215141911.2345.log
Last 10 log lines:
_dgram_write in bss_dgram.o
_fd_write in bss_fd.o
_fd_puts in bss_fd.o
_sock_write in bss_sock.o
_sock_puts in bss_sock.o
(maybe you meant: _UI_method_get_writer, _RAND_write_file , _PEM_write_bio_PKCS7_stream , _PEM_write_X509_AUX , _PEM_write_PrivateKey , _PEM_write_bio_PrivateKey_traditional , _PEM_write_bio_PrivateKey , _PEM_write_PKCS8_PRIV_KEY_INFO , _PEM_write_bio_PKCS8_PRIV_KEY_INFO , _PEM_write_PKCS8PrivateKey , _PEM_write_bio_PKCS8PrivateKey , _PEM_write_bio , _PEM_X509_INFO_write_bio , _PEM_write_bio_PUBKEY , _PEM_write_DHparams , _PEM_write_EC_PUBKEY , _PEM_write_bio_EC_PUBKEY , _PEM_write_bio_ECPKParameters , _PEM_write_DSA_PUBKEY , _PEM_write_bio_RSA_PUBKEY , _PEM_write_RSAPublicKey , _PEM_write_PKCS7 , _PEM_write_bio_PKCS7 , _PEM_write_X509_CRL , _PEM_write_bio_X509_REQ_NEW , _PEM_write_X509_REQ , _PEM_write_bio_X509 , _PEM_write_PKCS8 , _PEM_write_DHxparams , _PEM_write_DSAparams , _PEM_write_ECPKParameters , _PEM_write_bio_RSAPrivateKey , _UI_method_set_writer , _PEM_write_bio_X509_AUX , _PEM_write_ECPrivateKey , _SMIME_write_CMS , _PEM_write_DSAPrivateKey , _PEM_write_X509 , _PEM_write , _PEM_write_bio_DSAPrivateKey , _PEM_write_bio_X509_CRL , _PEM_write_bio_NETSCAPE_CERT_SEQUENCE , _SMIME_write_PKCS7 , _PEM_ASN1_write , _PEM_ASN1_write_bio , _PEM_write_bio_CMS , _CRYPTO_THREAD_write_lock , _PEM_write_bio_DHxparams , _PEM_write_bio_DSAparams , _PEM_write_RSA_PUBKEY , _TXT_DB_write , _PEM_write_PUBKEY , _BIO_meth_set_write_ex , _BIO_meth_set_write , _BIO_meth_get_write , _PEM_write_bio_DSA_PUBKEY , _BIO_write_ex , _PEM_write_bio_X509_REQ , _PEM_write_bio_Parameters , _PEM_write_bio_ECPrivateKey , _PEM_write_bio_PKCS8 , _PEM_write_X509_REQ_NEW , _PEM_write_bio_DHparams , _BIO_ctrl_get_write_guarantee , _BIO_meth_get_write_ex , _PEM_write_bio_PKCS8PrivateKey_nid , _PEM_write_bio_ASN1_stream , _PEM_write_bio_CMS_stream , _BIO_write , _PEM_write_CMS , _PEM_write_RSAPrivateKey , _PEM_write_NETSCAPE_CERT_SEQUENCE , _PEM_write_PKCS8PrivateKey_nid , _SMIME_write_ASN1 , _PEM_write_bio_RSAPublicKey )
ld: symbol(s) not found for architecture x86_64
clang-4.0: error: linker command failed with exit code 1 (use -v to see invocation)
make[1]: *** [libcrypto.dylib] Error 1
make: *** [all] Error 2
Do you know how can I fix this one?
Here is the terminal response after installing with instructions here
You are running this to install Bundler (You can think about it as the gem storage). And here you know that for the jekyll error code, it has the same issue (it is not finding the source to run jekyll). To fix this, install jekyll
If you want to run the jekyll from bundler, try this (recommended) Reference
bundle add jekyll #This will add jekyll to Gemfile (gem dependencies manager)
bundle install #This will check/install the gem from Gemfile
bundle exec jekyll #This will run jekyll from the bundle
If you don't want to use bundle, you can install the gem directly
gem install jekyll
jekyll #this should work and have message related to jekyll
Edit after update 1: (and posted reply to further debug things)
Basically, if you can do these (manual thing of the commands above)
Have Gemfile with gem "jekyll" line inside
can run bundle install and success, then you can proceed with the other jekyll related things.
Ruby 2.6 is the 2018 version and has reached end of life
I'd start by upgrading ruby to 3.0 or 3.1 (a lot of gems may not be compatible with 3.2 yet)
Read-only file system # rb_sysopen
Permission issue perhaps? Check if the directory is read only or root access only.
rbenv is a tool for managing ruby versions. You could consider installing ruby through rbenv instead of a plain system install. Would probably solve the permission problem as well.
I see several problems with your setup.
You are using an EOL version of Ruby that is no longer supported.
You are using a system installed ruby which requires root permissions to manage. Apart from security considerations, this creates further issues in gem maintenance.
Because you are forced to run gem install as superuser I don't think that the jekyll binary is set up correctly in the correct path. I think what may have happened is that paths or binaries were setup for the root user instead of your user, as a side effect of running with sudo.
What I recommend is installing a userspace Ruby version manager. My preferred is rbenv because if it's simplicity of operation, but there are others like RVM.
What this entails is:
Installing rbenv (it's quite simple - just follow their README).
Install a recent Ruby version that jekyll supports, like 3.0.5 via:
rbenv install 3.0.5
Run bundle install or gem install jekyll.
rbenv will setup your Ruby environment in userspace where sudo will not be required. All binaries should be correctly accessible in your path and your setup should now be working correctly.
P.S. You may have to restart your terminal session after installing rbenv and after installing the required Ruby version.
I am trying to update ruby gems by using:
gem update --system
But I am getting error:
ERROR: While executing gem ...(Gem::RemoteFetcher::UnknownHostError)
no such name (https://rubygems.org/specs.4.8.gz).
Unsure what version of rubygems you have installed, however there are three ways to fix:
network issues - try again later.
the version you have is bricked for updates, and you will need to install another way
NOTE: RubyGems 1.1 and 1.2 have problems upgrading when there is no rubygems-update installed. You will need to use the following instructions if you see Nothing to update. If you have an older version of RubyGems installed, then you can still do it in two steps:
$ gem install rubygems-update # might need to be admin/root
$ update_rubygems
Failing that you have to get your hands dirty:
Download from https://rubygems.org/pages/download
Unpack into a directory and cd there
Install with: ruby setup.rb (you may need admin/root privilege)
See https://rubygems.org/pages/download for more info
After installing rvm, updating .gmrc file, updating rubygems and running gem install rails -v ">=3.1.0rc", I now seem to have a complete mess:
$ rails -v
/usr/local/lib/site_ruby/1.8/rubygems/dependency.rb:247:in `to_specs': Could not find rails (>= 0) amongst [] (Gem::LoadError)
from /usr/local/lib/site_ruby/1.8/rubygems/dependency.rb:256:in `to_spec'
from /usr/local/lib/site_ruby/1.8/rubygems.rb:1182:in `gem'
from /var/lib/gems/1.8/bin/rails:18
myhome#myhome-mini:~$ gem env
RubyGems Environment:
- RUBYGEMS VERSION: 1.6.2
- RUBY VERSION: 1.9.2 (2011-02-18 patchlevel 180) [i686-linux]
- INSTALLATION DIRECTORY: /home/myhome/gems
- RUBY EXECUTABLE: /home/myhome/.rvm/rubies/ruby-1.9.2-p180/bin/ruby
- EXECUTABLE DIRECTORY: /home/myhome/gems/bin
- RUBYGEMS PLATFORMS:
- ruby
- x86-linux
- GEM PATHS:
- /home/myhome/gems
- /usr/lib/ruby/gems/1.8
- GEM CONFIGURATION:
- :update_sources => true
- :verbose => true
- :benchmark => false
- :backtrace => false
- :bulk_threshold => 1000
- "gemhome" => "/home/myhome/gems"
- "gempath" => ["/home/myhome/gems", "/usr/lib/ruby/gems/1.8"]
- REMOTE SOURCES:
- http://rubygems.org/
I've had a similiar problem. Not sure if that helps you, but you might try to install gems with rvmsudo gem install [gemname] instead of just doing gem install [gemname] or sudo gem install [gemname].
I try to explain this a bit because of the upvotes:
This basically is a path issue. If you set up gems via gem install, they mostly likely will be in another directory (e.g. /usr/local/) compared to gems set up via bundler (where you can override it with --path). Using sudo may also set them up into another directory since sudo starts a subshell which has a different environment then. This is why you have rvmsudo.
If you want to see the differences, compare $PATH, $GEM_HOME, $GEM_PATH and $BUNDLE_PATH when echoing directly, with sudo and with rvmsudo.
I had to sudo gem install bundler to make it work again.
I got a problem similar to this, there may be a compatible problem of rvm.
I fixed by updating rvm to latest version:
curl -L https://get.rvm.io | bash -s stable --ruby
Then you should reload rvm or just open new terminal window.
Then I reinstalled the bundler 'gem install bundler' and ran 'bundle install' as normal
rvm rubygems current
did the trick for me.
remove ruby first
then
sudo apt-get install build-essential libssl-dev libreadline5 libreadline5-dev zlib1g zlib1g-dev
to install all needed lib
then you could install ruby and rails
rvm install 1.9.3
rvm --default use 1.9.3
rvm gem install rails
I had pretty much the same message when trying to generate a controller after installing IntelliJ IDEA and the associated Plugin for Rail Dev. From my app directory I just executed bundle install and was then able to generate controllers again.
I know this is a really old question but I just recently decided to move to RVM on a server I had setup a while ago and was having this same problem where gems were being installed in the wrong place and it was just messing everything up.
After a few hours of crawling through SO, I finally figured out that in my .gemrc file in my root folder, I had previously setup the gemhome: and gempath: variables and they were messing with the whole system.
After removing these lines, all my gems were working property.
Just thought I would post my answer in case someone was in the same position.
I've been poking around the internet looking for a solution on this one... with no luck..
I'm new to rails... If anyone has an idea, I'd love to hear it. Much appreciated!
I enter:
LW:src liamwright$ sudo gem install rails --include-dependencies
And Get:
INFO: `gem install -y` is now default and will be removed
INFO: use --ignore-dependencies to install only the gems you list
Bulk updating Gem source index for: http://gems.rubyforge.org
ERROR: could not find rails locally or in a repository
I am running:
ruby 1.8.6 (2008-08-11 patchlevel 287) [universal-darwin9.0]
Mac OS X 10.5.8
I also tried:
gem sources -r gems.rubyonrails.org
And Get:
source gems.rubyonrails.org not present in cache
Just to check...
...try doing a sudo gem update --system before installing Rails to make sure you have the latest RubyGems installed?
EDIT: Actually, if your RubyGems install is really old, you might need to follow the alternate directions on Gemcutter.
Might want to make sure you have the newest rubygems:
sudo gem install rubygems-update
sudo gem update --system
Then:
sudo gem install rails
I came across this solution on Albertux' blox. Running this script will fix it (It worked perfectly for me on an Ubuntu 9.10 machine):
#!/bin/bash
#(download the latest on http://rubyforge.org/frs/?group_id=126)
wget http://rubyforge.org/frs/download.php/43984/rubygems-update-1.3.0.gem
sudo gem install rubygems-update-1.3.0.gem
sudo update_rubygems
# now this work:
sudo gem update --system
echo "done."
I've just had the same problem trying to upgrade rubygems from 1.2.0 to 1.3.7.
Setp-1)
So I just downloaded rubygems-update-1.3.7.gem from http://rubyforge.org/frs/?group_id=126
Setp-2)
gem install rubygems-update-1.3.7.gem
Setp-3)
update_rubygems
and it work for me.
Problem: Cannot install any gem, any type. But I want to install riddle if that matters.
When I run sudo gem install "gem_name" I get the following error:
WARNING: RubyGems 1.2+ index not found for:
RubyGems will revert to legacy indexes degrading performance.
Bulk updating Gem source index for: http://gems.rubyforge.org/
What to do??
Check your sources
gem sources
rebuild index for affected sources, e.g.
gem generate_index http://gems.rubyforge.org
1) Here is the answer!!!!
- slow connection
2) Solution
- move to a new connection.
-
This might not affect people in the 1st world, but I live in China and this was a huge problem as few people seem to have experienced this.
Basically the error means that the connection is to slow and gives up saying no index found. But there is not documentation or help out there on this, except for a few posts about changing gem sources, and MERB causing problems, but all that failed for me.
I was having the same problem and ran the following:
gem env
And saw that I had the following sources in my rubygems configuration:
http://gems.rubyforge.org
http://gems.rubyonrails.org
http://gems.github.com
Based on other answers I've seen here and on the web I decided to remove the rubyonrails.org reference:
sudo gem sources -r http://gems.rubyonrails.org
I was then able to install the gem I was trying to get without the RubyGems 1.2+ index error.
So I'd suggest trimming your list of sources down to just rubyforge and github and then trying to install the gem you want.
I solved this problem by
rm -rf ~/.gem
And then run "gem install" again
Try to add the another gem source. For example github:
sudo gem sources -r http://gems.rubyforge.org
sudo gem sources -a http://gems.github.com
You are running an old RubyGems version.
Upgrade to the latest RubyGems 1.3.x branch.
$ rubygems update --self
If it doesn't work (RubyGems 1.2.0 has a weird bug that prevents --self update) then install rubygems_update
$ wget http://rubyforge.org/frs/download.php/60717/rubygems-update-1.3.5.gem
$ gem install rubygems-update-1.3.5.gem
$ update_rubygems
Use sudo if your os requires it.
Could be a daft entry in /etc/hosts...