是否可以在不安装的情况下下载特定于平台的Ruby gem?

时间:2009-12-02 14:16:27

标签: ruby install gem

我在这个问题上gem fetch回答gem install gosu --remote个问题is-it-possible-to-download-a-ruby-gem-without-installing-it-automatically。但窗户我并不总是得到Windows宝石。

使用Successfully installed gosu-0.7.15-x86-mswin32-60安装Windows版本gem fetch gosu

使用Downloaded gosu-0.7.15下载时,我得到gem fetch gosu-0.7.15-x86-mswin32-60这是linux版本,无法安装在我的Windows PC上。

使用ERROR: Could not find gosu-0.7.15-x86-mswin32-60 in any repository和类似尝试询问特定宝石会产生{{1}}

在使用fetch和install时,有关如何为我的PC获取正确版本的任何想法吗?

1 个答案:

答案 0 :(得分:4)

$ 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'

你应该能够做到

$ gem fetch gosu --platform x86-mswin32

或者只需转到download page