【问题标题】:Is it possible to download a platfrom specific Ruby gem without installing it?是否可以在不安装的情况下下载特定于平台的 Ruby gem?
【发布时间】:2009-12-02 14:16:26
【问题描述】:

我在这个问题is-it-possible-to-download-a-ruby-gem-without-installing-it-automatically 上阅读了gem fetch 的答案。但是 windows 我并不总是得到 windows gem。

使用gem install gosu --remote安装windows版本Successfully installed gosu-0.7.15-x86-mswin32-60

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

使用 gem fetch gosu-0.7.15-x86-mswin32-60 和类似的尝试请求特定的 gem 产生 ERROR: Could not find gosu-0.7.15-x86-mswin32-60 in any repository

关于在使用 fetch 与 install 时如何为我的 PC 获取正确版本的任何想法?

【问题讨论】:

    标签: ruby installation gem


    【解决方案1】:
    $ 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

    【讨论】:

      猜你喜欢
      • 2019-04-13
      • 1970-01-01
      • 2017-03-03
      • 1970-01-01
      • 2013-03-27
      • 2023-03-03
      • 1970-01-01
      • 2015-06-24
      • 2012-10-26
      相关资源
      最近更新 更多