【发布时间】:2018-04-02 04:37:24
【问题描述】:
对于这个 Gemfile:
source 'https://rubygems.org'
ruby '2.3.1' # equivalent version to what jruby supports
gem 'jrubyfx'
Bundler 找不到 gem,即使 it is clearly available:
$ bundle install
Fetching gem metadata from https://api.rubygems.org/..........
Could not find gem 'jrubyfx' in any of the gem sources listed in your Gemfile.
如果我让 gem 自己完成工作,它 可以很好地找到它:
$ gem install jrubyfx
Successfully installed jrubyfx-1.2.0-java
1 gem installed
所以现在我什至在我的系统上都有它,但尽管它甚至存在于本地,但 Bundler 仍然找不到它。
环境:
$ bundle --version
Bundler version 1.16.0.pre.3
$ gem --version
2.6.8
$ rbenv version
jruby-9.1.8.0 (set by /Users/trejkaz/Documents/prototype/.ruby-version)
$ ruby --version
jruby 9.1.8.0 (2.3.1) 2017-03-06 90fc7ab Java HotSpot(TM) 64-Bit Server VM 25.151-b12 on 1.8.0_151-b12 +jit [darwin-x86_64]
$ jenv version
1.8 (set by /Users/trejkaz/Documents/prototype/.java-version)
$ java -version
java version "1.8.0_151"
Java(TM) SE Runtime Environment (build 1.8.0_151-b12)
Java HotSpot(TM) 64-Bit Server VM (build 25.151-b12, mixed mode)
我已经验证 gem 和 bundler 都在运行 JRuby - 它们都需要很长时间才能启动,而我目前只安装了一个 JRuby(Homebrew 的 ruby-build 提供的最新版本)。
到目前为止尝试过:
- 将源从
https更改为http - 更改 URL 以包含前导
api. - 将
--full-index添加到bundle命令行中,如this question 的回答中所建议的那样 - this question 看起来也很相似,但只是少了一个逗号
【问题讨论】:
标签: ruby rubygems bundler jruby