Domanda

I'm developing a project with Ruby on Rails and my operating system is Windows 7. Some point I had to use a java .jar library for handling some works. I've searched a lot but I couldn't find a way how I can do that.

I've installed jRuby standalone. But when I entered 'ruby -v' on console, I still see ruby. Also I can enter 'jruby -v' and it shows jRuby version correctly. However I couldn't integrate them.

Since RVM doesn't run on Windows, I couldn' say 'rvm use' etc. I basically wanted to do that.

How can I do that and use .jar files in my Ruby On Rails project on Windows?

È stato utile?

Soluzione

You will have to run the entire rails app in jruby. I would suggest you run your current app with https://github.com/jruby/jruby-lint to look for any conflicts. After you have your app jruby compliant, you can run rails via

   jruby -S rails server

To require your jar file

    require 'java'
    require 'path/to/mycode.jar'

Always prepend any rails or rake commands with the jruby -S command

Altri suggerimenti

Pik is like RVM, but for Windows. That might answer part of your question.

Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top