jruby

How to call Java API from Ruby 1.8 or 1.9

╄→尐↘猪︶ㄣ 提交于 2019-11-28 09:06:37
问题 I've this JRuby working code (stolen from Keith's Blog), which wraps the SAXON xslt processor API. Now, I wonder whether I can and how can I wrap the same API in Ruby framework? Please tell me if this question is non-sense or if it can be improved in some way. This is the java doc reference for the wanted API. And this is the JRuby code I'm using: require 'java' module JXslt include_class "javax.xml.transform.TransformerFactory" include_class "javax.xml.transform.Transformer" include_class

What exactly “config.assets.debug” setting does?

血红的双手。 提交于 2019-11-28 08:59:17
I have started development of simple rails application. After several hours work I have notices that somehow the deleted css is still applied to the web pages. In order to fix the issue I executed the following actions several times: stop/start server use rails server use torquebox server delete browser cache but nothing changes. It was very strange - the new css definitions were applied, but those that I have deleted were still there. So, I gave up and decided to create new project. I have setup the new project (its scaffold is the same as the first one) and when I open one of the views, the

How to enable C extension support in jRuby?

◇◆丶佛笑我妖孽 提交于 2019-11-27 21:18:24
I want to install a gem but I get the following error: Building native extensions. This could take a while... ERROR: Error installing twitter-login: ERROR: Failed to build gem native extension. C:/nwcloud/jruby-1.7.2/bin/jruby.exe extconf.rb NotImplementedError: C extension support is not enabled. Pass -Xcext.enabled=true to JRuby or set JRUBY_OPTS or modify .jrubyrc to enable. I also read this question with the same problem, but I don't even know how to enable the support with the three options because I don't know how to pass -Xcext.enabled=true to JRuby or set JRUBY_OPTS or modify .jrubyrc

How do I find my PID in Java or JRuby on Linux?

大憨熊 提交于 2019-11-27 20:44:12
I need to find the PID of the current running process on a Linux platform (it can be a system dependent solution). Java does not support getting the process ID, and JRuby currently has a bug with the Ruby method, Process.pid. Is there another way to obtain the PID? Mike Stone If you have procfs installed, you can find the process id via the /proc/self symlink, which points to a directory whose name is the pid (there are also files here with other pertinent information, including the PID, but the directory is all you need in this case). Thus, with Java, you can do: String pid = new File("/proc

Create deployable JRuby JAR file?

天大地大妈咪最大 提交于 2019-11-27 18:48:09
I need to compile my JRuby application into a standalone JAR file. How can I do this? docwhat Warbler 1.3.0 or newer can also be used to make an executable JAR file. Quick instructions. Make sure you're using JRuby`s gem, etc. here: $ gem install warbler $ mkdir bin $ cat <<EOF > bin/myapp #!/usr/bin/env jruby puts "Hello World" EOF $ chmod a+x bin/myapp $ warble jar You should now have a myapp.jar file in the current directory. According to the README you just add any libraries you need in the lib directory and use either (or both) a .gemspec or Gemfile to control any other gems that need to

Can I program for android using any JVM language?

江枫思渺然 提交于 2019-11-27 15:38:41
问题 Can I use other JVM languages besides Java (e.g. jruby, jython, clojure) to program for android, or is it java only? There was a similar question asked over a year ago but I wasn't sure if there'd been any change since then. 回答1: Check out these links: Scala 2.8 on Android Android examples in Scala Clojure on Android Ruboto - An IRB application for JRuby on Android Android Scripting (Python, Perl, JRuby, Lua, BeanShell, JavaScript, Tcl) However, I am unaware of any prominent applications that

How to make JRuby 1.6 default to Ruby 1.9?

倖福魔咒の 提交于 2019-11-27 10:13:22
what is the best way to make JRuby to run in 1.9 mode by default? i.e, I want to run rake test instead of jruby --1.9 -S rake test Thank you Use the JRUBY_OPTS environment variable. JRUBY_OPTS holds a list of arguments that are added to any arguments specified on the command line. For example (on Linux): $ jruby -v jruby 1.6.0.RC1 (ruby 1.8.7 patchlevel 330) (2011-01-10 769f847) (Java HotSp... $ export JRUBY_OPTS=--1.9 $ jruby -v jruby 1.6.0.RC1 (ruby 1.9.2 trunk 136) (2011-01-10 769f847) (Java HotSpot(TM... $ export JRUBY_OPTS=--1.8 $ jruby -v jruby 1.6.0.RC1 (ruby 1.8.7 patchlevel 330) (2011

SASS implementation for Java? [closed]

谁都会走 提交于 2019-11-27 10:09:33
I'm looking for SASS implementation in Java (could be used with JSP/JSF). For Python I've found CleverCSS, but there is nothing for Java. Anyone heard something about this sort of tool for generating CSS? With ANT: Download JRuby complete jar file ( JRuby Complete jar download page ) Download the latest HAML/SASS code ( HAML/SASS tarball ), and extract it. Put it in "/libs/sass-[VERSION]" Add the following to an ant build file. Replace [VERSION] in the script to the corresponding versions of JRuby and SASS Run the ant script, and the sass or scss files will be compiled! <path id="JRuby">

How to improve jRuby load time?

喜你入骨 提交于 2019-11-27 06:53:29
问题 I have to wait quite long time (comparing to my friends machines) for executing scripts on jRuby, especially when I'm running rake tasks or tests. I've tried jRuby version 1.3.1 and 1.4.1 with and without ruby-debug gem and the same problem occurred in each configuration. The question is simple: Is there any way to improve jRuby load process? ..or have I something wrong with my jvm configuration or jRuby installation (I'm using jRuby via rvm - ruby version manager)? 回答1: There are a couple of

Visit method not found in my rspec

左心房为你撑大大i 提交于 2019-11-27 03:48:44
My java web application is running on tomcat at http://localhost:8080/ Writing my first spec, home_spec: require 'spec_helper' describe "home" do it "should render the home page" do visit "/" page.should have_content("hello world") end end And running: rspec I get: F Failures: 1) home should render the home page Failure/Error: visit "/" NoMethodError: undefined method `visit' for #<RSpec::Core::ExampleGroup::Nested_1:0x242870b7> # ./spec/home/home_spec.rb:7:in `(root)' Finished in 0.012 seconds 1 example, 1 failure Failed examples: rspec ./spec/home/home_spec.rb:6 # home should render the home