jruby

How to create distribution files(.exe) with jruby

喜夏-厌秋 提交于 2020-01-04 08:06:07
问题 I have created a JRuby desktop application. Now I need to install on different platforms(Windows, Linux, Mac). Can any one help me on this Which is the painless method to create installation files OR executables with jruby. I googled and tried with RubyScript2exe, OCRA but none of these succeeded(really dont understood much). I am a noobie.. I really need it... EDIT - TRYING A SIMPLE METHOD as jrubyc can create java equivalent class files(described here) To start with packaging I created a

How to create distribution files(.exe) with jruby

南楼画角 提交于 2020-01-04 08:05:45
问题 I have created a JRuby desktop application. Now I need to install on different platforms(Windows, Linux, Mac). Can any one help me on this Which is the painless method to create installation files OR executables with jruby. I googled and tried with RubyScript2exe, OCRA but none of these succeeded(really dont understood much). I am a noobie.. I really need it... EDIT - TRYING A SIMPLE METHOD as jrubyc can create java equivalent class files(described here) To start with packaging I created a

jruby on rails - error when star server (rails s) command is used

雨燕双飞 提交于 2020-01-03 17:44:34
问题 A error is thrown when rails s command is used in the context of my project. The following is my application settings: JRuby (1.7.0.preview2) Rails (3.2.8) IBM DB2 Express C (1.01) active-record-jdbc-adapter (1.2.2) and this is the java error: # # A fatal error has been detected by the Java Runtime Environment: # # EXCEPTION_PRIV_INSTRUCTION (0xc0000096) at pc=0x0155b803, pid=8552, tid=9692 # # JRE version: 7.0_06-b24 # Java VM: Java HotSpot(TM) Client VM (23.2-b09 mixed mode, sharing windows

Problems Calling a Java Class from JRuby

允我心安 提交于 2020-01-03 16:41:55
问题 I'm trying to use boilerpipe from JRuby. I've seen the guide for calling Java from JRuby, and have used it successfully with another Java package, but can't figure out why the same thing isn't working with boilerpipe. I'm trying to basically do the equivalent of this Java from JRuby: URL url = new URL("http://www.example.com/some-location/index.html"); String text = ArticleExtractor.INSTANCE.getText(url); Tried this in JRuby: require 'java' url = java.net.URL.new("http://www.example.com/some

How to set title for text_field?

旧城冷巷雨未停 提交于 2020-01-02 07:40:11
问题 I know that is something simple, but I'm stuck. I have a several forms in my rails3 app to which I need to add tooltips, by using the tipsy. The text in tooltips should be determined in title\original-title, but I just can't figure it out, how to set it for text_field. <%= f.text_field :what %> gives me <input id="name_which" name="name[which]" size="30" type="text"> and I just can't figure it out, where to put the title text. For example, this one in html works fine <input type="text" name=

running nokogiri in Jruby vs. just ruby

只谈情不闲聊 提交于 2020-01-01 22:29:54
问题 I found startling difference in CPU and memory consumption usage. It seems garbage collection is not happening when i run the following nokogiri script require 'rubygems' require 'nokogiri' require 'open-uri' def getHeader() doz = Nokogiri::HTML(open('http://losangeles.craigslist.org/wst/reb/1484772751.html')) puts doz.xpath("html[1]\/body[1]\/h2[1]") end (1..10000).each do |a| getHeader() end when run in Jruby, CPU consumption is over 10, and memory consumption % rises with time(starts from

PDFBox Inconsistent PDTextField Autosize Behavior after setValue

烂漫一生 提交于 2019-12-31 05:45:32
问题 I am using Apache PDFBox for configuration of PDTextField 's on a PDF document where I load Lato onto the document using: font = PDType0Font.load( @j_pd_document, java.io.FileInputStream.new('/path/to/Lato-Regular.ttf') ) # => Lato-Regular font_name = pd_default_resources.add(font).get_name # => F4 I then pass the font_name into a default_appearance_string for the PDTextField like so: j_text_field.set_default_appearance("/#{font_name} 0 Tf 0 g") # where font_name is # passed in from above The

Jruby: NameError: uninitialized constant Neo4j

谁说胖子不能爱 提交于 2019-12-31 04:29:25
问题 I ran this example from git: https://github.com/andreasronge/neo4j require "rubygems" require 'neo4j' Neo4j::Transaction.run do node = Neo4j::Node.new(:name => 'andreas') node.outgoing(:friends) << Neo4j::Node.new(:name => 'peter') node.outgoing(:friends).each {|node| puts "name #{node[:name]}"} end and it outputted the error: NameError: uninitialized constant Neo4j const_missing at org/jruby/RubyModule.java:2626 (root) at ./neo4j.rb:4 require at org/jruby/RubyKernel.java:1027 require at .

JRuby script with Rubeus and Swing exiting once packaged into jar using warble

独自空忆成欢 提交于 2019-12-30 11:02:00
问题 I am trying to package a simple JRuby script into a jar file. The script uses Rubeus::Swing and runs correctly when executed with the JRuby interpreter. require 'rubygems' require 'rubeus' class Example01 extend Rubeus::Swing def show JFrame.new("Rubeus Swing Example 01") do |frame| frame.visible = true end end end Example01.new.show Once I package the script into a JAR with warble , when I execute: java -jar jtest.jar ... the JFrame window shows up and instantly closes. There is no

Failed to build gem native extension with JRuby

ⅰ亾dé卋堺 提交于 2019-12-30 07:39:08
问题 I change the ruby version from ruby 1.9.3-p125 to JRuby 1.7.0-preview1 with ruby-build. When I execute jruby -S bundle install on my project, there are some errors as below, ... Using bson (1.6.2) Installing bson_ext (1.6.2) with native extensions Gem::Installer::ExtensionBuildError: ERROR: Failed to build gem native extension. /Users/joshchang/.rbenv/versions/jruby-1.7.0-preview1/bin/jruby extconf.rb NotImplementedError: C extension support is not enabled. Pass -Xcext.enabled=true to JRuby