Rvm with Jruby 1.7.0 "Unknown Ruby Interpreter"

RVM With JRuby 1.7.0 Unknown Ruby Interpreter

RVM has limited support of the ruby directive, you can use comment to overwrite what will be used by RVM:

#ruby=jruby-1.7.0

CentOS RVM Error: Unknown ruby string (do not know how to handle): ruby-2.1.0

I just came across the same issue and filed it at https://github.com/wayneeseguin/rvm/issues/3244.

This appears to be a bug in rvm 1.26.7 and as a workaround, you can downgrade to 1.26.6 by running:

\curl -sSL https://get.rvm.io | bash -s -- --version 1.26.6
rvm reload

Edit:
RVM 1.26.8 was releases and fixed this issue, running rvm get stable is the preferred fix now.

Specifying JRuby Version in Bundler

as suggested by the comment already linking to RVM reports Gemfile ruby as not installed

RVM's support for resolving a Ruby "engine" from the Gemfile is limited and does not match how Heroku is using (parsing) the directive.

if you really want to have it both in the Gemfile use a comment for RVM e.g.

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"
# ...

RVM and different Ruby versions in ONE project

Ruby and JRuby can't run in the same process, so to use them together in the same project you need to have separate processes, and some kind of inter-process communication. This could be as simple as having the JRuby program execute a Ruby script using backticks, receiving stdout from the process as a string, or as much more complicated than that as it has to be. To get fancier, you could use a FIFO or a message queue, for instance.

How to get rails to work with jruby and rvm - ruby version keeps flipping

what is says is definitely worth following :

Your Ruby version is 2.3.3, but your Gemfile specified 2.5.1

if you do a rvm jruby-9.1.17.0 do ruby --version you will get smt like :

jruby 9.1.17.0 (2.3.3) 2018-04-20 d8b1ff9 Java HotSpot(TM) 64-Bit Server VM 25.171-b11 on 1.8.0_171-b11 +jit [linux-x86_64]

the (2.3.3) part means its Ruby 2.3 so I recommend you use JRuby 9.2 :

rvm install jruby-9.2.8.0

will give you a 2.5(.3) compatible Ruby runtime, update Gemfile accordingly :

"ruby '2.5.3', :engine => 'jruby', :engine_version => '9.2.8.0'" 

RVM reports Gemfile ruby as not installed

According to this SO answer:

RVM has limited support of the ruby directive, you can use comment to overwrite what will be used by RVM.


By adding:

#ruby=jruby-1.7.9

to the Gemfile just below the ruby directive, rvm seems to be able to pick the right ruby:

$ cd kotoba
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 /home/petey/rails/kotoba/Gemfile'.
To ignore the warning for all files run 'rvm rvmrc warning ignore allGemfiles'.

$ ruby -v
jruby 1.7.9 (1.9.3p392) 2013-12-06 87b108a on OpenJDK 64-Bit Server VM 1.7.0_25-b30 [linux-amd64]

bundle install hangs in Jruby with rails 4.2

first of all "minor-changes" might not be enough for switching Rails (esp. ActiveRecord) ... the C drivers use the MRI API which is not supported in JRuby, you need to setup the JDBC adapter which does the same using "native" Java APIs e.g. for MySQL :

gem 'mysql2', platform: :mri
gem 'jdbc-mysql', platform: :jruby
gem 'activerecord-jdbc-adapter', platform: :jruby

NOTE: as of the time of this answer Rails 4.2 is not supported with AR-JDBC (they did a lot of internal AR refactorings that might take a while to finish up)



Related Topics



Leave a reply



Submit