Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

GEM Version Requirements Deprecated

When creating a new Rails project using:

rails sample

Then creating a model using:

script/generate model person first_name:string last_name:string

Everything is fine. However, if I add any gems to my environment.rb:

config.gem "authlogic"

And run the same generator, I get the following:

/Library/Ruby/Gems/1.8/gems/rails-2.3.5/lib/rails/gem_dependency.rb:119:Warning: Gem::Dependency#version_requirements is deprecated and will be removed on or after August 2010.

The warning just recently appeared (I think), but I would like to fix it if possible. Any hints or similar experiences?

Thanks.

like image 358
Kevin Sylvestre Avatar asked Feb 20 '26 05:02

Kevin Sylvestre


1 Answers

did you try:

rake gems:install

Btw. If you are using rubygems 1.3.6 then you get this deprecation warning. Previous versions never gave a warning. Also i suggest installing any gem using the command line rather than adding it in the environment.rb file. If the gem(s) you have added in the file is/are not installed, then the generator or any rake task will simply not run. Its a minor bug.

Here is an article that describes a way to prevent the warning: http://www.mattvsworld.com/blog/2010/03/version_requirements-deprecated-warning-in-rails/

Its no big deal though. Just install gems the normal way and don't add any to your environment.rb file. You'll never get the deprecation warning.

like image 115
Shripad Krishna Avatar answered Feb 22 '26 01:02

Shripad Krishna