-
-
Notifications
You must be signed in to change notification settings - Fork 569
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
0.9.1 gem appears to require Nokogiri ~> 1.6.0 on Ruby 1.8.7 #198
Comments
According to this blog post, gem runtime dependencies appear to be evaluated at build-time, not install-time, which is why this does not appear to be working. A Wikibooks entry linked from that blog post provides a possible solution for this. I can create a pull request for this if you think this is an appropriate way to resolve this issue. |
@Umofomia Would you be willing to submit a PR that resolves this issue? I'm OK with the wikibooks solution. |
@Lordnibbler So I tried to implement the Wikibooks solution and it does not really work the way that I originally expect it to. It appears that the extension will install the version of nokogiri you specify, but it doesn't really work with Bundler at all to make sure that the version that it installs actually resolves with the dependencies in your project's Gemfile. For instance, I could make this gem install the following dependencies: di = Gem::DependencyInstaller.new
begin
if RUBY_VERSION < '1.9'
# 1.8.7
di.install 'nokogiri', '~> 1.5.10'
else
di.install 'nokogiri', '~> 1.6.0'
end
rescue => e
exit(1)
end ...but if a project specifies in its Gemfile a conflicting version of nokogiri (e.g., version For this reason, I don't think the Wikibooks solution is the one we want. How do you feel about the other solution I previously mentioned (specify just one dependency that is |
@Umofomia Thanks for looking into this issue. I believe we've previously locked the dependency to |
@Lordnibbler Yeah, it's not ideal. I've seen other gems deal with this issue by explicitly noting in their README file to specify
https://github.com/aws/aws-sdk-ruby/blob/aws-sdk-v1/README.md How about something similar in the README for this gem? |
@Umofomia I'm ok with this approach -- can you please verify that this works as expected both in 1.8.7 and newer, and submit a pull request? |
@Lordnibbler I just opened pull request #199 and tested it with various Ruby versions to make sure it works. However it looks like I will need to update the Travis CI configuration to make sure the right version of Nokogiri is installed for 1.8.7 and ree. |
@Lordnibbler The Travis CI build now passes so check out the pull request when you get the chance. Thanks! |
fixed via #199 |
#194 loosened the runtime requirement on Nokogiri so that version
~> 1.6.0
would be accepted for Ruby 1.9 and above:However, this code does not appear to be working and
~> 1.6.0
is being enforced for 1.8.7 as well.The easiest way to reproduce this issue is to create a clean project with the following Gemfile:
This results in the following:
If you try to add a version constraint for Nokogiri in the Gemfile, you end up getting the following error instead:
So it doesn't appear that Bundler is honoring the version-dependent dependency. One possible fix I can think of is to have just one dependency that is
>= 1.5.10
; however, I don't know whether you would consider that to be too broad.The text was updated successfully, but these errors were encountered: