How do I upgrade Rubygems in Bluemix? - ruby

How do I upgrade Rubygems in Bluemix? I'm getting this message:
Rubygems 2.0.14.1 is not threadsafe, so your gems must be installed one at a time. Upgrade to Rubygems 2.1.0 or higher to enable parallel gem installation.
and since I have a lot of gems, I'd really like to use this feature.
I'm using Ruby buildpack version 1.6.7 and Ruby 2.0.0.

gem install rubygems-update
update_rubygems
# gem update --system # in fact, you are done on the previous step

Use gem update --system as stated here

Solved by using newer Ruby version 2.2.2 in newer buildpack.

Related

Bundler version for Ruby 2.3.8?

I currently have 2 ruby versions, 2.5.5 and 2.3.8, I am managing them with rbenv, and for gems, I use bundler to manage my specific gem versions. I have an issue when I want to switch to a project that uses 2.3.8 or a version that has to do with Ruby version 2.3.
My question is how do I get bundler to run the command to bundle install interact with my 2.3 projects.
My current version of bundler is 2.0.2.
I have already tried installing a lower version of bundler of which the bundler website claims to interact with ruby version 2.3.
I thought that if I specified the command to run bundle _version_ install it would work, but it still gave me the response that it needed ruby version 2.5 for bundler to work.
Lots of help appreciated.
In some situations, isolation can help. I would like to recommend rvm (https://github.com/rvm/rvm) for managing ruby versions. This tool is very similar to rbenv but in comparison, it allows you to create gemsets which are kind of containers of gems for special purposes. For instance:
rvm install 2.5.5 --disable-binary
rvm use 2.5.5#name-of-gemset --create
gem install bundler
bundle install # inside your project folder with Gemfile
I think that you will not have problems with versions again.

My version of RubyGems is too new to install RubyInline/ZenTest

I'm trying to install the RubyInline gem, but to no avail. It says that ZenTest needs RubyGems between versions 1.8 and 2.1. I have RubyGems 2.1.7.
Is RubyInline/ZenTest working on making it compatible with the newer versions?
This is a known (and reported issue) that the author has commented on here:
https://github.com/seattlerb/zentest/issues/48
Feel free to 'watch' that thread for a posted release that fixes this.
What version of ZenTest are you running? The current is 4.9.3.
Try running gem out ZenTest or gem list ZenTest to see if yours is out of date.
You can update all your stale gems using gem up.
You can clean out the stale gems after that using gem clean.

Would 'gem update --system' make my previously installed gems incompatible?

I tried to install hoe and I encounted this:
Installing hoe (2.9.1)
/Library/Ruby/Site/1.8/rubygems/installer.rb:170:in
`install': hoe requires RubyGems
version >= 1.4. Try 'gem update
--system' to update RubyGems itself. (Gem::InstallError)
I am now worried the update might corrupt my previous installed gems...
gem update --system will only update rubygems itself.
Previously installed gems are not affected and should run just like before.
Or is there a specific gem or situation you are worried about?
Upgrading RubyGems won't affect previously installed Gems.

RubyGems refuses to update from 1.3.1 to 1.3.5

I can't update the rubygems from 1.3.1 to 1.3.5. I've tried the following commands with no luck(logged in as the root)
gem update --system
gem update rubygems
gem update rubygems -v 1.3.5
gem install rubygems-update -v 1.3.5
The response for the first three command is
Updating RubyGems
Nothing to update
while for the last one the response is
ERROR: could not find gem rubygems-update locally or in a repository
Also the current rubygem fails to install some required gems such as 'geokit'. Could the problems be related?
Current Ruby version 1.8.5 on CentOS 5.0
This might sound silly but do you have gems.rubyforge.org in your remote sources?

How do you downgrade rubygems?

I have rubygems 1.3.1 installed but I want to go back to 1.2.0. What's the command to downgrade rubygems?
This worked for me when downgrading from 1.5.2 to 1.4.2 because of old rails version:
sudo gem update --system 1.4.2
More information about downgrading/upgrading rubygems: https://github.com/rubygems/rubygems/blob/master/UPGRADING.md
Updated November 2011: Now that RVM's out, try running rvm install rubygems <version>.
If you're using RVM, then you can do this to remove current ruby gems, then upgrade/downgrade rubygems:
rvm install rubygems 1.4.2
This just worked for me on OSX to get from 1.5.0 back to 1.4.2
sudo gem uninstall -v '1.5.0' rubygems-update
sudo gem update --system --local
I had a similar problem in an old Rails 3 stack. When these type of issues occur, my recommendation is to go onto the production server that the application is currently running in and check out which rubygems version it is using:
gem -v
For me, it was using 1.8.24. So all I needed to do is downgrade my current rubygems which was generated from "rvm install 1.9.3", when I installed the old ruby for this app. I ran the following command:
$ rvm install rubygems 1.8.24 --force
And it worked. Note I am running Ubuntu 14.04 and the server I am using is also Ubuntu.
I used this command to go back to the gem version that my ruby version needed:
rvm rubygems current
If it gives checksum errors try
rvm rubygems current --verify-downloads 1
That did the trick for me.

Resources