GEM Version Requirements Deprecated

When creating a new Rails project with:

rails sample

Then create 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 on # version_requirements has been deprecated and will be removed after August 2010.

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

Thank.

+3
source share
4 answers

Have you tried:

rake: install

Btw. rubygems 1.3.6, . . , , environment.rb. (), ,/ , . .

, : http://www.mattvsworld.com/blog/2010/03/version_requirements-deprecated-warning-in-rails/

. environment.rb. .

+2

, rails 3.0, , , : http://omgbloglol.com/post/353978923/the-path-to-rails-3-approaching-the-upgrade "config.gem , ", .

, rails 3.0, , Gemfile . :

gem 'authlogic'

sudo bundle install

:)

+2
+1

Entering these lines in your config / environment.rb between your bootstrap and your initializer will remove the failure warning:

if Gem::VERSION >= "1.3.6"
  module Rails
    class GemDependency
      def requirement
        super == Gem::Requirement.default ? nil : super
      end
    end
  end
end
+1
source

Source: https://habr.com/ru/post/1739580/


All Articles