Coder Social home page Coder Social logo

Comments (8)

eLod avatar eLod commented on July 26, 2024 1

@dblock i believe he meant @Koroeskohr 's gemfile, the same you suggested. I think we all agree, that @Koroeskohr 's problem is that he wants to use numbers_and_words, but by default that fetches AS 5.0 for him, which requires ruby 2.2, while he wants 2.1. the solution as both of you said is just pin AS in his gemfile.

edit: actually it has another layer. so @Koroeskohr is developing a gem. and such i guess he wants his gem to work on both ruby 2.1 and 2.2. that said i was under the impression bundler/gemspec is smart enough to understand that on 2.1 it can only install AS < 5.0.

@Koroeskohr can you provide us more information what is failing/how to reproduce?

from numbers_and_words.

jlduran avatar jlduran commented on July 26, 2024

the gem now requires ActiveSupport 5.0

I don't think so: https://github.com/kslazarev/numbers_and_words/blob/master/Gemfile#L4. It should use any version of activesupport.

Do you mind posting a sample Gemfile that reproduces the issue?

from numbers_and_words.

Koroeskohr avatar Koroeskohr commented on July 26, 2024

My gem just has those two dependencies in the .gemspec file :

spec.add_runtime_dependency "numbers_and_words"
spec.add_runtime_dependency "reform"

and is supposed to serve apps that use Ruby 2.1. When running the test suite for the gem out of a Rails app, it fetches ActiveSupport 5.0.0, which asks for Ruby 2.2.2. Probably an inevitable caveat, requiring a forced ActiveSupport version on my end, even though my application doesn't depend on it

from numbers_and_words.

dblock avatar dblock commented on July 26, 2024

If you want a lower version of AS than 5, you should tell your app in Gemfile with gem 'activesupport', '~> 4.0' for example, otherwise it always tries to select the most recent one.

I'll close this, it works as designed I believe.

from numbers_and_words.

jlduran avatar jlduran commented on July 26, 2024

Probably an inevitable caveat, requiring a forced ActiveSupport version on my end

Exactly, you should add that restriction on your Gemfile / .gemspec: http://guides.rubygems.org/patterns/#declaring-dependencies

from numbers_and_words.

dblock avatar dblock commented on July 26, 2024

@jlduran Are you saying we should add it in numbers_and_words? I don't agree. This gem works well with ActiveSupport 5.0, your problem is that it brings a version of Ruby you don't want, no?

from numbers_and_words.

jlduran avatar jlduran commented on July 26, 2024

@dblock wrote:
Are you saying we should add it in numbers_and_words?

No, it was a suggestion for @Koroeskohr's .gemspec file.

He can, either create a Gemfile and restrict AS < 5, even a .ruby-version file to build the gem (this would be a way of doing it without including the dependency in his .gemspec file) or – the proper way – forcing the dependency on his .gemspec file, after all, is his gem that is not compatible with AS 5, even if it does not use AS directly, it is needed by numbers_and_words (imagine I try to include his gem on a Rails 5 project, for instance).

from numbers_and_words.

eLod avatar eLod commented on July 26, 2024

@jlduran @dblock well reading his description again he said 'a gem i work with requires numbers_and_words'. i'm not sure if that means developing an app/project that depends on a gem (that depends on numbers_and_words) or developing a gem (that depends on numbers_and_words). i just tested, and bundle install with a Gemfile that only has numbers_and_words in it on ruby 2.1 does give you an error (Gem::InstallError: activesupport requires Ruby version >= 2.2.2.). so if he is developing an app/project that runs on 2.1 he should just pin AS < 5 himself in his own Gemfile, if he is developing a gem the users of his gem should pin AS < 5 in their own Gemfile.

from numbers_and_words.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.