簡體   English   中英

在Bundler中指定JRuby版本

[英]Specifying JRuby Version in Bundler

我找不到能夠回答此問題的SO QA。

我通過rvm install jruby ,然后生成了一個新的Rails應用程序。 為了允許通過rvm自動更改紅寶石版本,我發現Bundler允許您添加:

ruby '1.9.3', engine: 'jruby', engine_version: '1.7.12'

請參閱此處以供參考 由於版本號為1.3,因此我在根應用目錄下檢查了Bundler版本:

$ bundle -v
Bundler version 1.6.2

我假設我具有此功能。 現在,當我繼續將其添加到Gemfile時:

source 'https://rubygems.org'
ruby '1.9.3', engine: 'jruby', engine_version: '1.7.12'

gem 'rails', '4.1.1'
gem 'activerecord-jdbcsqlite3-adapter'

然后在運行cd .. && cd app我收到此問題:

RVM used your Gemfile for selecting Ruby, it is all fine - Heroku does that too,
you can ignore these warnings with 'rvm rvmrc warning ignore  /Users/benmorgan/Sites/sigma/Gemfile'.
To ignore the warning for all files run 'rvm rvmrc warning ignore allGemfiles'.

Unknown ruby string (do not know how to handle): ruby-1.9.3,engine:jruby,engine_version:1.7.12.

您知道如何告訴rvm選擇jruby版本嗎? Gemfile中是否可能?

正如評論所建議的那樣,已經鏈接到RVM報告Gemfile ruby​​未安裝

RVM對從Gemfile解析Ruby“引擎”的支持有限,並且與Heroku使用(解析)指令的方式不匹配。

如果您真的想在Gemfile中都使用它,請為RVM使用注釋,例如

source "https://rubygems.org"
#ruby=jruby-1.7.12
if ENV["JRUBY"] || RUBY_PLATFORM == "java"
  ruby "1.9.3", engine: "jruby", engine_version: "1.7.12"
end

gem "rails", "~> 4.1.1"
# ...

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM