Skip to content
This repository has been archived by the owner on Apr 14, 2021. It is now read-only.

Attempts to install dependencies with platform :rbx on MRI #2774

Closed
mvz opened this issue Dec 23, 2013 · 14 comments
Closed

Attempts to install dependencies with platform :rbx on MRI #2774

mvz opened this issue Dec 23, 2013 · 14 comments

Comments

@mvz
Copy link
Contributor

mvz commented Dec 23, 2013

On Rubinius, (parts of) the ruby standard library need to be specified in the Gemfile (see rubinius/rubinius#2827). However, I can't get bunder to ignore the gem using the platform option. A minimal Gemfile that illustrates the problem looks like this:

source 'https://rubygems.org'
gem 'rubysl', platform: :rbx

Calling bundle install --local with this Gemfile on MRI causes Bundler to complain that the rubysl gem is not installed.

I have made a reproduction script:

https://gist.github.com/mvz/8099820

@indirect
Copy link
Member

I have heard from @brixen that this is working fine for many people. I'm not sure what's different in your particular case, and I'm not super familiar with using rubysl because I don't use Rubinius on a daily basis.

@brixen
Copy link
Contributor

brixen commented Dec 24, 2013

I created the following repo to help debug Bundler + RubySL issues:

https://github.com/rubinius/bundler-canary

On eg Ubuntu 10.04 64bit, I get the following result:

vagrant@lucid64:~/devel/bundler-canary$ ruby -v
ruby 1.8.7 (2012-02-08 patchlevel 358) [x86_64-linux]
vagrant@lucid64:~/devel/bundler-canary$ bundle -v
Bundler version 1.3.5
vagrant@lucid64:~/devel/bundler-canary$ bundle install --local
Resolving dependencies...
Could not find gem 'rubysl (>= 0) ruby' in the gems available on this machine.
vagrant@lucid64:~/devel/bundler-canary$ bundle install
Fetching gem metadata from https://rubygems.org/..........
Resolving dependencies...
Using rake (10.1.1)
Using bundler (1.3.5)
Your bundle is complete!
Use `bundle show [gemname]` to see where a bundled gem is installed.

As seen above, bundle install under MRI succeeds, but bundle install --local does not.

I can try with a different version of MRI if that would help.

@mvz
Copy link
Contributor Author

mvz commented Dec 30, 2013

@brixen thanks for looking into this. My results are indeed the same as yours: bundle install turns out to work fine, and bundle exec works fine thereafter. It is just with --local, and running bundle exec before bundle install that problems occur.

@zzak
Copy link
Contributor

zzak commented Jan 1, 2014

Might this be related to #2791

@mvz
Copy link
Contributor Author

mvz commented Jan 1, 2014

@zzak not likely. I'm experiencing this both in Bundler 1.3.5, which should be from before the change that introduced #2791, and in 1.5.1, which is from after that change.

@thomasfedb
Copy link
Contributor

I'm experiencing what seems to be the same issue. I'm trying to bundle the sshkit gem for development.

It's Gemfile includes:

platforms :rbx do
  gem 'rubysl', '~> 2.0'
  gem 'rubysl-json'
end

And running either bundle or bundle install results in:

Fetching gem metadata from https://rubygems.org/.......
Fetching additional metadata from https://rubygems.org/..
Resolving dependencies...
Could not find gem 'rubysl-json (>= 0) ruby' in the gems available on this machine.

This is with bundler version 1.5.1 with MRI 2.0.0p247.

@brixen
Copy link
Contributor

brixen commented Jan 9, 2014

@thomasfedb please use gem 'json'. The rubysl-json gem was a mistake before I realized the code was being imported to MRI from the existing json gem. Once you change that, you'll need to clear the .lock file.

The other issue here is also that the .lock file doesn't include enough platform information to know to not even look for that gem when running MRI.

@thomasfedb
Copy link
Contributor

@brixen There was no lock file present.

I will change the gemfile and submit a PR to sshkit.

@mvz
Copy link
Contributor Author

mvz commented Apr 19, 2014

I just found out this problem does not occur if, e.g., :jruby is specified as the platform.

@mvz
Copy link
Contributor Author

mvz commented May 11, 2014

Note that the problem only occurs if the gem in question (in this case, rubysl) is not installed for the currently running ruby.

@indirect
Copy link
Member

oh! I bet the remote gemspec standin doesn't have proper platform information, and we aren't fetching it because it's expensive. It will slow things down, but we probably need to do it. :/ (Or wait for the new index format that includes it without any additional requests).

On Sun, May 11, 2014 at 5:27 PM, Matijs van Zuijlen
[email protected] wrote:

Note that the problem only occurs if the gem in question (in this case, rubysl) is not installed for the currently running ruby.

Reply to this email directly or view it on GitHub:
#2774 (comment)

@mvz
Copy link
Contributor Author

mvz commented May 11, 2014

@indirect it works fine when I allow Bundler to fetch remote data. It is only when running with --local that it fails. And yes, I want to use --local because I don't want to wait for Bundler to fetch info from rubygems.

@indirect
Copy link
Member

Oh. So, when you use --local, you are explicitly forbidding Bundler from downloading information about the gem's platform... but that shouldn't stop us from being able to check if the platform we are on matches the platform that the Gemfile puts the gem in. I understand now. Thanks for explaining!

@andremedeiros
Copy link
Member

I think this one can now be closed.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants