jruby

Find out which gems require native c extensions from a Gemfile?

无人久伴 提交于 2019-12-21 01:48:12
问题 I just recently started shifting attention towards deploying Ruby apps atop TorqueBox which of course is built atop Jruby. Hitherto I have been basically performing a bundle install and then tackling each gem along the way to jrubydom, but I've hit a couple gems that have taken me some considerable time to resolve due to needing to reimplement large portions of them. Is there a way to invoke bundler or rubygems to run through all gems and their deps to test if they require native c extensions

Find out which gems require native c extensions from a Gemfile?

半世苍凉 提交于 2019-12-21 01:48:08
问题 I just recently started shifting attention towards deploying Ruby apps atop TorqueBox which of course is built atop Jruby. Hitherto I have been basically performing a bundle install and then tackling each gem along the way to jrubydom, but I've hit a couple gems that have taken me some considerable time to resolve due to needing to reimplement large portions of them. Is there a way to invoke bundler or rubygems to run through all gems and their deps to test if they require native c extensions

How to setup neo4j with dBpedia ontop of ruby-on-rails application?

守給你的承諾、 提交于 2019-12-20 19:57:29
问题 I am trying to use dBpedia with neo4j ontop of ruby on rails . Assuming I have installed neo4j and downloaded one of the dBpedia datasets. How do I import the dbpedia dataset into neo4j ? 回答1: The simplest way to load dbpedia into Neo4j is to use the dbpedia4neo library. This is a Java library, but you don't need to know any Java because all you need to do is run the executable. You could rewrite this in JRuby if you want, but regular Ruby won't work because it relies on Blueprints, a Java

Does Scala scale better than other JVM languages?

可紊 提交于 2019-12-20 09:47:43
问题 Here is the only way I know to ask it at the moment. As Understand it Scala uses the Java Virtual Machine. I thought Jruby did also. Twitter switched its middleware to Scala. Could they have done the same thing and used Jruby? Could they have started with Jruby to start with and not had their scaling problems that caused them to move from Ruby to Scala in the first place? Do I not understand what Jruby is? I'm assuming that because Jruby can use Java it would have scaled where Ruby would not.

JRuby Error: Your application used more memory than the safety cap of 500m

♀尐吖头ヾ 提交于 2019-12-20 06:28:11
问题 I was running a JRuby something.rb script and suddenly it throws this: Error: Your application used more memory than the safety cap of 500m. Specify -J-Xmx####m to increase it (#### = cap size in MB). Specify -w for full OutOfMemoryError stack trace What caused this and how do I fix it? 回答1: You are running out of memory (heap) reserved for Java virtual machine. Try to increase it in server startup with command line parameters or configuration files. Something like this: server_start_command

Running rake task from within war file

筅森魡賤 提交于 2019-12-20 05:52:29
问题 My code base initially was written in ruby. It had a rakefile.rb file to perform db migration. I later changed the whole thing to jruby for the ease of deployment which works fine. Only problem I am facing is how to run my rake task (to perform db migrations). I tried java -jar GV_S.war -S rake db_migrate[1] with 1 being the version but this didn't work. this gave me : [Winstone 2012/03/23 18:04:56] - Beginning extraction from war file [Winstone 2012/03/23 18:04:56] - WARNING: The Servlet 2.4

How to install Nokogiri Gem for Windows

℡╲_俬逩灬. 提交于 2019-12-18 11:44:27
问题 I'm having this problem with nokogiri's gem: Could not open library 'C:\Ruby187\lib\ruby\gems\1.8\gems\nokogiri-1.4.6-x86-mingw32\ext\nokogiri\libxml2.dll' : unknown I read that I had to try the 1.5.0.beta3 version. However, when I run C:\Users\t3en4>gem install nokogiri --pre Fetching: nokogiri-1.5.0.beta.4.gem (100%) ERROR: Error installing nokogiri: The 'nokogiri' native gem requires installed build tools. Please update your PATH to include build tools or download the DevKit from 'http:/

How to connect to Oracle using JRuby & JDBC

ⅰ亾dé卋堺 提交于 2019-12-18 11:39:15
问题 First approach: bare metal require 'java' require 'rubygems' require "c:/ruby/jruby-1.2.0/lib/ojdbc14.jar" # should be redundant, but tried it anyway odriver = Java::JavaClass.for_name("oracle.jdbc.driver.OracleDriver") puts odriver.java_class url = "jdbc:oracle:thin:@myhost:1521:mydb" puts "About to connect..." con = java.sql.DriverManager.getConnection(url, "myuser", "mypassword"); if con puts " connection good" else puts " connection failed" end The result of the above is: sqltest.rb:4:

Rails console runs without prompt

北战南征 提交于 2019-12-18 08:15:42
问题 When I run my rails console I got something like this: Loading development environment (Rails 3.2.3) /Users/sebastiannowak/.rvm/gems/jruby-1.6.7@global/gems/bundler-1.1.0/lib/bundler.rb:254 warning: shadowing outer local variable - path Switch to inspect mode. Time.now Time.now 2012-06-27 09:27:21 +0200 As you can see I can interact with console but it is quite uncomfortable. I run JRuby 1.6.7. Somebody has such issue? 回答1: Most probably somewhere in you ~/.irbrc , you're doing: IRB.conf[

How can I import all packages in jruby?

有些话、适合烂在心里 提交于 2019-12-18 05:59:10
问题 In java you can do something like this, to include all packages under java namespace. import java.*; At https://github.com/jruby/jruby/wiki/CallingJavaFromJRuby They suggest using include_package or import . I also tried java_package and java_import . Is there a way to import like this or do you just require the pacakges that you need. 回答1: require 'java' module JavaUtil include_package "java.util" end JavaUtil::Date.new 来源: https://stackoverflow.com/questions/14699949/how-can-i-import-all