Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to avoid deprecation messages from RubyGems?

Tags:

ruby

rubygems

gem

After gem update --system, when I do something related to rubygems, I receive this message:

NOTE: Gem::Specification#default_executable= is deprecated with no replacement. It will be removed on or after 2011-10-01.

Gem::Specification#default_executable= called from /usr/lib/ruby/gems/1.8/specifications/rubygems-update-1.7.2.gemspec:11.

How can I avoid it? I've tried to remove rubygems and reinstall, but that didn't fix it.

like image 305
Juanjo Avatar asked May 06 '11 09:05

Juanjo


People also ask

What is require RubyGems?

require 'rubygems' will adjust the Ruby loadpath allowing you to successfully require the gems you installed through rubygems, without getting a LoadError: no such file to load -- sinatra .

Does Ruby come with RubyGems?

Ruby comes with RubyGems by default since version 1.9, previous Ruby versions require RubyGems to be installed by hand. Some other libraries are released as archived (. zip or . tar.

What is RubyGems How does it work?

The RubyGems software allows you to easily download, install, and use ruby software packages on your system. The software package is called a “gem” which contains a packaged Ruby application or library. Gems can be used to extend or modify functionality in Ruby applications.


2 Answers

You probably need to regenerate your gem specifications.

After installing RubyGems 1.8.1 you will see deprecations when loading your exsting gems. Run gem pristine --all --no-extensions to regenerate your gem specifications safely.

http://blog.segment7.net/2011/05/05/rubygems-1-8-1

like image 60
PerfectlyNormal Avatar answered Nov 19 '22 21:11

PerfectlyNormal


Look where your rubygems are installed:

$ gem list -d rubygems

Find the deprecate.rb file there, and make the self.skip class method always return true.

or If you're using RVM, the following command will fix it:

rvm rubygems current
like image 24
charmae Avatar answered Nov 19 '22 22:11

charmae