7even/vkontakte_api

Deprecation warning

IvanKhoteev opened this issue · 9 comments

Have a good day!

gems/faraday-0.9.2/lib/faraday/request/retry.rb:30: warning: constant ::Fixnum is deprecated

If it possible, update dependency your gem to Faraday version '>=0.11'

7even commented

Hi.

vkontakte_api allows you to use Faraday 0.11 and beyond - you can update your application's dependencies to use it.

I don't think vkontakte_api should forbid using old versions of Faraday - this only affects Ruby 2.4 users AFAIK, and this is not really a problem.

Yes, I'm sorry about this my mistake, but when i install this gem it install faraday_middleware-parse_oj gem as dependency
And in this gem exists dependency gem.add_runtime_dependency 'faraday', '~> 0.9', and if i understand correctly this block update faraday gem

7even commented

And in this gem exists dependency gem.add_runtime_dependency 'faraday', '~> 0.9', and if i understand correctly this block update faraday gem

No, it should not block you from using Faraday 0.11. ~> 0.9 basically means "any 0.x version starting from 0.9" (here's an article about this operator and it's usage in dependency declarations).

Maybe some other gem in your application blocks you from updating Faraday. You can check this by specifying gem 'faraday', '>= 0.11' in your Gemfile and doing bundle update faraday - if there is some blocker bundler will report it.

I'm create new project and add add only gem vkontakte_api

Gemfile:

source 'https://rubygems.org'

git_source(:github) do |repo_name|
  repo_name = "#{repo_name}/#{repo_name}" unless repo_name.include?("/")
  "https://github.com/#{repo_name}.git"
end

gem 'rails', '~> 5.1.1'
gem 'sqlite3'
gem 'puma', '~> 3.7'
gem 'sass-rails', '~> 5.0'
gem 'uglifier', '>= 1.3.0'
gem 'coffee-rails', '~> 4.2'
gem 'turbolinks', '~> 5'
gem 'jbuilder', '~> 2.5'

group :development, :test do
  gem 'byebug', platforms: [:mri, :mingw, :x64_mingw]
end

group :development do
  gem 'web-console', '>= 3.3.0'
  gem 'listen', '>= 3.0.5', '< 3.2'
  gem 'spring'
  gem 'spring-watcher-listen', '~> 2.0.0'
end

gem 'tzinfo-data', platforms: [:mingw, :mswin, :x64_mingw, :jruby]

gem 'vkontakte_api', '~> 1.4'

After start bundle install i got this result:

GEM
  remote: https://rubygems.org/
  specs:
    actioncable (5.1.1)
      actionpack (= 5.1.1)
      nio4r (~> 2.0)
      websocket-driver (~> 0.6.1)
    actionmailer (5.1.1)
      actionpack (= 5.1.1)
      actionview (= 5.1.1)
      activejob (= 5.1.1)
      mail (~> 2.5, >= 2.5.4)
      rails-dom-testing (~> 2.0)
    actionpack (5.1.1)
      actionview (= 5.1.1)
      activesupport (= 5.1.1)
      rack (~> 2.0)
      rack-test (~> 0.6.3)
      rails-dom-testing (~> 2.0)
      rails-html-sanitizer (~> 1.0, >= 1.0.2)
    actionview (5.1.1)
      activesupport (= 5.1.1)
      builder (~> 3.1)
      erubi (~> 1.4)
      rails-dom-testing (~> 2.0)
      rails-html-sanitizer (~> 1.0, >= 1.0.3)
    activejob (5.1.1)
      activesupport (= 5.1.1)
      globalid (>= 0.3.6)
    activemodel (5.1.1)
      activesupport (= 5.1.1)
    activerecord (5.1.1)
      activemodel (= 5.1.1)
      activesupport (= 5.1.1)
      arel (~> 8.0)
    activesupport (5.1.1)
      concurrent-ruby (~> 1.0, >= 1.0.2)
      i18n (~> 0.7)
      minitest (~> 5.1)
      tzinfo (~> 1.1)
    arel (8.0.0)
    bindex (0.5.0)
    builder (3.2.3)
    byebug (9.0.6)
    coffee-rails (4.2.1)
      coffee-script (>= 2.2.0)
      railties (>= 4.0.0, < 5.2.x)
    coffee-script (2.4.1)
      coffee-script-source
      execjs
    coffee-script-source (1.12.2)
    concurrent-ruby (1.0.5)
    erubi (1.6.0)
    execjs (2.7.0)
    faraday (0.9.2)
      multipart-post (>= 1.2, < 3)
    faraday_middleware (0.9.2)
      faraday (>= 0.7.4, < 0.10)
    faraday_middleware-parse_oj (0.3.2)
      faraday (~> 0.9)
      faraday_middleware (>= 0.9.1, < 1.0)
      oj (>= 2.0, < 4.0)
    ffi (1.9.18)
    globalid (0.4.0)
      activesupport (>= 4.2.0)
    hashie (3.5.5)
    i18n (0.8.1)
    jbuilder (2.6.4)
      activesupport (>= 3.0.0)
      multi_json (>= 1.2)
    jwt (1.5.6)
    listen (3.1.5)
      rb-fsevent (~> 0.9, >= 0.9.4)
      rb-inotify (~> 0.9, >= 0.9.7)
      ruby_dep (~> 1.2)
    loofah (2.0.3)
      nokogiri (>= 1.5.9)
    mail (2.6.5)
      mime-types (>= 1.16, < 4)
    method_source (0.8.2)
    mime-types (3.1)
      mime-types-data (~> 3.2015)
    mime-types-data (3.2016.0521)
    mini_portile2 (2.1.0)
    minitest (5.10.2)
    multi_json (1.12.1)
    multi_xml (0.6.0)
    multipart-post (2.0.0)
    nio4r (2.0.0)
    nokogiri (1.7.2)
      mini_portile2 (~> 2.1.0)
    oauth2 (1.3.1)
      faraday (>= 0.8, < 0.12)
      jwt (~> 1.0)
      multi_json (~> 1.3)
      multi_xml (~> 0.5)
      rack (>= 1.2, < 3)
    oj (3.0.7)
    puma (3.8.2)
    rack (2.0.3)
    rack-test (0.6.3)
      rack (>= 1.0)
    rails (5.1.1)
      actioncable (= 5.1.1)
      actionmailer (= 5.1.1)
      actionpack (= 5.1.1)
      actionview (= 5.1.1)
      activejob (= 5.1.1)
      activemodel (= 5.1.1)
      activerecord (= 5.1.1)
      activesupport (= 5.1.1)
      bundler (>= 1.3.0, < 2.0)
      railties (= 5.1.1)
      sprockets-rails (>= 2.0.0)
    rails-dom-testing (2.0.3)
      activesupport (>= 4.2.0)
      nokogiri (>= 1.6)
    rails-html-sanitizer (1.0.3)
      loofah (~> 2.0)
    railties (5.1.1)
      actionpack (= 5.1.1)
      activesupport (= 5.1.1)
      method_source
      rake (>= 0.8.7)
      thor (>= 0.18.1, < 2.0)
    rake (12.0.0)
    rb-fsevent (0.9.8)
    rb-inotify (0.9.8)
      ffi (>= 0.5.0)
    ruby_dep (1.5.0)
    sass (3.4.23)
    sass-rails (5.0.6)
      railties (>= 4.0.0, < 6)
      sass (~> 3.1)
      sprockets (>= 2.8, < 4.0)
      sprockets-rails (>= 2.0, < 4.0)
      tilt (>= 1.1, < 3)
    spring (2.0.1)
      activesupport (>= 4.2)
    spring-watcher-listen (2.0.1)
      listen (>= 2.7, < 4.0)
      spring (>= 1.2, < 3.0)
    sprockets (3.7.1)
      concurrent-ruby (~> 1.0)
      rack (> 1, < 3)
    sprockets-rails (3.2.0)
      actionpack (>= 4.0)
      activesupport (>= 4.0)
      sprockets (>= 3.0.0)
    sqlite3 (1.3.13)
    thor (0.19.4)
    thread_safe (0.3.6)
    tilt (2.0.7)
    turbolinks (5.0.1)
      turbolinks-source (~> 5)
    turbolinks-source (5.0.3)
    tzinfo (1.2.3)
      thread_safe (~> 0.1)
    uglifier (3.2.0)
      execjs (>= 0.3.0, < 3)
    vkontakte_api (1.4.3)
      faraday (~> 0.9.0)
      faraday_middleware (~> 0.9.1)
      faraday_middleware-parse_oj (~> 0.3)
      hashie (>= 2.0)
      oauth2 (>= 0.8)
    web-console (3.5.1)
      actionview (>= 5.0)
      activemodel (>= 5.0)
      bindex (>= 0.4.0)
      railties (>= 5.0)
    websocket-driver (0.6.5)
      websocket-extensions (>= 0.1.0)
    websocket-extensions (0.1.2)

PLATFORMS
  ruby

DEPENDENCIES
  byebug
  coffee-rails (~> 4.2)
  jbuilder (~> 2.5)
  listen (>= 3.0.5, < 3.2)
  puma (~> 3.7)
  rails (~> 5.1.1)
  sass-rails (~> 5.0)
  spring
  spring-watcher-listen (~> 2.0.0)
  sqlite3
  turbolinks (~> 5)
  tzinfo-data
  uglifier (>= 1.3.0)
  vkontakte_api (~> 1.4)
  web-console (>= 3.3.0)

BUNDLED WITH
   1.14.6

If i add in gemfile gem 'faraday', '>=0.11' and run bundle install i got it:

You have requested:
  faraday >= 0.11

The bundle currently has faraday locked at 0.9.2.
Try running `bundle update faraday`

If you are updating multiple gems in your Gemfile at once,
try passing them all to `bundle update`

And run bundle update got me this:

Bundler could not find compatible versions for gem "faraday":
  In Gemfile:
    faraday (>= 0.11)

    vkontakte_api (~> 1.4) was resolved to 1.4, which depends on
      faraday (~> 0.9.0)
7even commented

Bundler uses 1.4 version of vkontakte_api for some reason in your case, not the 1.4.3. What if you write gem 'vkontakte_api', '1.4.3' instead of '~> 1.4' in your Gemfile? Maybe that could help?

No, it doesn' help

Bundler could not find compatible versions for gem "faraday":
  In Gemfile:
    faraday (>= 0.11)

    vkontakte_api (= 1.4.3) was resolved to 1.4.3, which depends on
      faraday (~> 0.9.0)

Hello, if I correctly understand pessimistic operator, bundler is corresponding faraday ~> 0.9.0 for your gem and it mean support >= 0.9.0 and <0.10
I can't find which gem in your gem dependencies add this dependence

shkrt commented

@IvanKhoteev had the same issue, fixed by switching to git source. This has been fixed long ago in 47b6627 but seems like latest version of gem was not pushed to rubygems

7even commented

@IvanKhoteev @shkrt try updating to the latest version of vkontakte_api (I just released 1.4.4).