jruby

How to generate bytecode in Ruby 1.9?

一个人想着一个人 提交于 2019-12-24 05:49:10
问题 How can I generate byetcode from Ruby 1.9?? My intent is to generate bytecode not the source code and ship it along with my application package. I am aware of the JRuby approach but I am facing certain issues there 回答1: Call BCEL library from JRuby. BCEL library is shipped with JDK. 来源: https://stackoverflow.com/questions/4014016/how-to-generate-bytecode-in-ruby-1-9

How do you choose gems for a high throughput multithreaded Rails app? [closed]

坚强是说给别人听的谎言 提交于 2019-12-24 05:05:38
问题 Closed . This question needs to be more focused. It is not currently accepting answers. Want to improve this question? Update the question so it focuses on one problem only by editing this post. Closed 5 years ago . Basically, I got burnt by EventMachine which claimed JRuby compatibility but the java implementation failed on thread safety issues in standard patterns ( Thread.new{EM.run} doesn't work under JRuby for example) - we're talking pretty basic EM functions here. Unfortunately, most

How do you choose gems for a high throughput multithreaded Rails app? [closed]

时间秒杀一切 提交于 2019-12-24 05:05:18
问题 Closed . This question needs to be more focused. It is not currently accepting answers. Want to improve this question? Update the question so it focuses on one problem only by editing this post. Closed 5 years ago . Basically, I got burnt by EventMachine which claimed JRuby compatibility but the java implementation failed on thread safety issues in standard patterns ( Thread.new{EM.run} doesn't work under JRuby for example) - we're talking pretty basic EM functions here. Unfortunately, most

Cannot call bundle by jruby-complete-1.7.21.jar

喜夏-厌秋 提交于 2019-12-24 02:57:14
问题 I've read http://spin.atomicobject.com/2013/04/24/bundler-jruby-complete/ and installed faraday, rspec and bundler gems with commands like: export GEM_HOME=/var/lib/tomcat6/shared/gems export GEM_PATH=/var/lib/tomcat6/shared/gems java -jar jruby-complete-1.7.21.jar -S gem install bundler And I see these gems in the list provided by java -jar jruby-complete-1.7.21.jar -S gem list I also can require files from these gems in inline jruby script, called through JSR223 from Activiti BPM, which is

Java Reflection: Determining class of java.util.regex.Pattern in JRuby

删除回忆录丶 提交于 2019-12-24 01:21:57
问题 Working on a legacy JRuby app (1.6.8) running under Java 11, I traced a peculiar error a test case: "require 'java'; puts java::util::regex::Pattern.class" errors ArgumentError: wrong number of arguments (0 for 1) . For other built-in JRE classes, this seems to work fine (see below). This causes JRuby itself to fail sometimes, at this line in https://github.com/jruby/jruby/blob/1.6.8/lib/ruby/site_ruby/shared/builtin/javasupport/core_ext/object.rb#L10 : if self.class.superclass.instance

Get JRuby jar path

…衆ロ難τιáo~ 提交于 2019-12-23 20:26:54
问题 Similar to this question, I'd like to know how to get the current jar file's path. But unlike the other question, I want to know the jar 's path, not the path of the current file inside the jar. For example, say I had a jruby jar at "/Users/MyUser/Jars/foo.jar" and inside was a compiled ruby file at "foo.jar/java/style/class/path.class". How could class.path get the path "/Users/MyUser/Jars/foo.jar"? I also saw a way to do it in Java, but I just don't know how to translate it... 回答1: I have

Creating new rails project with jruby in 1.9 compatibility mode hangs when running bundle install

会有一股神秘感。 提交于 2019-12-23 20:11:15
问题 Anyone encountered this problem? I am able to create the project fine in 1.8 compatibility mode. Here is what I am using Mac OSX Lion JRuby 1.6.4 Java 1.6.0_31 rvm 1.8.1 I am running the following command JRUBY_OPTS=--1.9 rails new myapp This goes ahead and creates all the files required for the app and then hangs at the statement. run bundle install When I look at Activity Monitor the java process is using up most of the cpu. 回答1: Summarizing the answer from the comments in order to remove

jruby - is ruby lambda syntax -> not an important consideration?

核能气质少年 提交于 2019-12-23 20:03:11
问题 I noticed that new lambda syntax -> in Ruby 1.9 is not supported even in the latest 1.6.4 jruby release. So, I am guessing this syntax is not commonly used in the ruby community. Is it because the syntax is new or are there any other disadvantages? x = -> y { y+1 } x.call(2) This returns 3 in ruby 1.9.1 and gives a syntax error in jruby 1.6.4 回答1: You are not running it in 1.9 mode. $ jruby --1.9 -S irb irb(main):001:0> x = -> y { y+1 } => #<Proc:0x1e937f@(irb):1 (lambda)> irb(main):002:0> x

curb(curl) for jruby?

十年热恋 提交于 2019-12-23 18:42:49
问题 i'm trying to use curl with jruby to get some response times for webpages/files. normally in ruby this would not be an issue and i could just install the gem (gem install curb) and all is well. curb appears to be incompatible with jruby, so is there an alternative that i can use to get web page load times in a similar fashion? i looked into the net/http class however it doesn't have a function that would work curl.total_time is what i would use if i could. any ideas? 回答1: According to the

Count number of records in a column family in an HBase table

喜你入骨 提交于 2019-12-23 14:02:13
问题 I'm looking for an HBase shell command that will count the number of records in a specified column family. I know I can run: echo "scan 'table_name'" | hbase shell | grep column_family_name | wc -l however this will run much slower than the standard counting command: count 'table_name' , CACHE => 50000 (because the use of the CACHE=>50000) and worse - it doesn't return the real number of records, but something like the total number of cells (if I'm not mistaken?) in the specified column