Is it possible to download a platfrom specific Ruby gem without installing it?
Question
I read a answer the gem fetch
answer on this question is-it-possible-to-download-a-ruby-gem-without-installing-it-automatically. But windows I do not always get the windows gem.
Using gem install gosu --remote
installs the windows version Successfully installed gosu-0.7.15-x86-mswin32-60
.
When downloading using gem fetch gosu
I get Downloaded gosu-0.7.15
which is the linux version and can not be installed on my windows PC.
Asking for the specific gem with gem fetch gosu-0.7.15-x86-mswin32-60
and similar tries yields ERROR: Could not find gosu-0.7.15-x86-mswin32-60 in any repository
Any ideas as to how to get the correct version for my PC when using fetch versus install?
Solution
$ gem fetch --help
Usage: gem fetch GEMNAME [GEMNAME ...] [options]
Options:
-v, --version VERSION Specify version of gem to fetch
--platform PLATFORM Specify the platform of gem to fetch
Local/Remote Options:
-B, --bulk-threshold COUNT Threshold for switching to bulk
synchronization (default 1000)
-p, --[no-]http-proxy [URL] Use HTTP proxy for remote operations
--source URL Use URL as the remote source for gems
Common Options:
-h, --help Get help on this command
-V, --[no-]verbose Set the verbose level of output
-q, --quiet Silence commands
--config-file FILE Use this config file instead of default
--backtrace Show stack backtrace on errors
--debug Turn on Ruby debugging
Arguments:
GEMNAME name of gem to download
Summary:
Download a gem and place it in the current directory
Defaults:
--version '>= 0'
You should be able to do
$ gem fetch gosu --platform x86-mswin32
Or simply go to the download page.