jruby

About running .class files generated by JRuby

半腔热情 提交于 2019-12-25 03:05:12
问题 Have a Ruby script, print "HELLO" If you use jrubyc script.rb You get a .class file. How do I execute this in my Java program? (so that it outputs "HELLO" to the console). I am using JRuby's complete JAR. 回答1: thus you've probably setup "embedded" (if not check-out answers such as this one) JRuby from Java e.g. (JSR 223 might be similar - just use ScriptEngine.eval to run Ruby code) : ScriptingContainer scriptContainer = new ScriptingContainer(LocalContextScope.CONCURRENT); scriptContainer

What are the Rails's ActiveRecord database gems on JRuby

只谈情不闲聊 提交于 2019-12-25 02:57:54
问题 When running rails on JRUBY, database adapters have two different gems. Sql Server : sqlserver gem Vs activerecord-sqlserver-adapter gem Mysql : jdbcmysql gem vs activerecord-jdbcmysql-adapter gem Sqlite3 : jdbcsqlite3 gem Vs activerecord-jdbcsqlite3-adapter gem Postgresql : jdbcpostgresql gem Vs activerecord-jdbcpostgresql-adapter gem jdbc : jdbc gem vs activerecord-jdbc-adapter gem So question is, What is the difference between jdbcpostgresql and its long form activerecord-jdbcpostgresql

Rails Model.save get datetime convertion error: “A conversão de um tipo de dados varchar em um tipo de dados…”

只愿长相守 提交于 2019-12-25 02:12:42
问题 I've a problem with SQL Server and Rails. Rails and SQL Server seems to save date format in different ways: Rails way: 2011-12-15 SQL Server: 15-12-2011 As I'm running SQL Server in Brazilian Portuguese so my problem might exist only for brazilian people. Whenever I do any Model.save on Rails, I'm getting this error: A conversão de um tipo de dados varchar em um tipo de dados datetime resultou em um valor datetime fora do intervalo.: <my query here> As Rails insert/update the created_at and

Rails Model.save get datetime convertion error: “A conversão de um tipo de dados varchar em um tipo de dados…”

孤者浪人 提交于 2019-12-25 02:11:22
问题 I've a problem with SQL Server and Rails. Rails and SQL Server seems to save date format in different ways: Rails way: 2011-12-15 SQL Server: 15-12-2011 As I'm running SQL Server in Brazilian Portuguese so my problem might exist only for brazilian people. Whenever I do any Model.save on Rails, I'm getting this error: A conversão de um tipo de dados varchar em um tipo de dados datetime resultou em um valor datetime fora do intervalo.: <my query here> As Rails insert/update the created_at and

Running rake db:migrate without some initializers

走远了吗. 提交于 2019-12-24 18:53:27
问题 I am trying to run jruby -S rake db:migrate , but I do not want to start up a daemon in config/initializers whenever I do a migrate. Is there a way to do this? Up until now, I have just been moving the daemon file to a file with a .bak extension so that rails doesn't load it when I do the migrate. I suspect that this is a stupid way of doing things. Is there a better way? Oh and I am running jruby ( if it matters ). 回答1: When run: NODAEMON=1 rake db:migrate In initializer: unless ENV[

Writing a Logstash GEM gives an error: undefined local variable or method

狂风中的少年 提交于 2019-12-24 12:37:28
问题 Trying to build a gem to use it for Logstash as a filter. I'm using classes and methods from a .jar file. The following is my Jruby code so far: # encoding: utf-8 require "logstash/filters/base" require "logstash/namespace" require 'java' require 'Processing.jar' java_import 'process.Process' class LogStash::Filters::Process < LogStash::Filters::Base config_name "process" StringPath = "/path/to/file/" ML = JavaUtilities.get_proxy_class('processing.Processing') @ML = ML.new(StringPath) public

No such file to load — rufus-scheduler

感情迁移 提交于 2019-12-24 11:36:42
问题 I'am developing a plugin in redmine how send mail every days , so i install rufus-scheduler and in my Gemfile i add this line gem "rufus-scheduler " and also i install the gem sudo gem install rufus-scheduler --source http://gemcutter.org and in my redmine/plugins/latest-issues-redmine-plugin/lib/latest_issues/view_hook_listener.rb i do this class LatestIssuesViewHookListener < Redmine::Hook::ViewListener require File.join(File.dirname(__FILE__), '../../app/models/latest_issues_setup')

Failed to write core dump. Core dumps have been disabled. To enable core dumping, try “ulimit -c unlimited” before starting Java again

假装没事ソ 提交于 2019-12-24 10:39:13
问题 I am beginner in shoes app, when I was trying to run a shoes app in the Ubuntu 12.04 terminal using shoes samples/test22.rb I'm getting this error: Failed to write core dump. Core dumps have been disabled. To enable core dumping, try "ulimit -c unlimited" before starting Java again. So how can I solve this or some one help me to run a simple shoes app in ubuntu and make a desktop app? 回答1: I'm guessing you are running shoes4. It runs fine for me on ubuntu 14.04, so let's figure out the

Switching rubies in shell script

痴心易碎 提交于 2019-12-24 05:54:09
问题 When executing a bash shell script I am using ruby 1.9.3. Then, within the script, I want to switch to JRub (I'm using rvm). I tried switching to JRuby by doing rvm use jruby within the script, but this didn't work, it said: RVM is not a function, selecting rubies with 'rvm use ...' will not work. You need to change your terminal emulator preferences to allow login shell. Sometimes it is required to use `/bin/bash --login` as the command. Please visit https://rvm.io/integration/gnome-terminal

Switching rubies in shell script

限于喜欢 提交于 2019-12-24 05:54:09
问题 When executing a bash shell script I am using ruby 1.9.3. Then, within the script, I want to switch to JRub (I'm using rvm). I tried switching to JRuby by doing rvm use jruby within the script, but this didn't work, it said: RVM is not a function, selecting rubies with 'rvm use ...' will not work. You need to change your terminal emulator preferences to allow login shell. Sometimes it is required to use `/bin/bash --login` as the command. Please visit https://rvm.io/integration/gnome-terminal