jruby

rails nested form changes id to decimal

家住魔仙堡 提交于 2019-12-13 06:06:37
问题 Quick problem description The value of the id in a nested form is rendered as 10006.0 instead of 10006 (decimal/float instead of an integer) resulting in an ActiveRecord::RecordNotFound exception. What is causing this behaviour?? The code setup So I followed the rails-guides tutorial on how to build nested forms. My 2 models are: class Broker < ActiveRecord::Base has_many :execution_groups, dependent: :destroy accepts_nested_attributes_for :execution_groups, allow_destroy: true, reject_if:

how to fix “Duplicate extensions not allowed” with logstash/jruby?

梦想与她 提交于 2019-12-13 02:23:32
问题 I'm running logstash like it saids in the starting page: java -jar logstash-1.2.1-flatjar.jar agent --config logstash-dev.conf With logstash-dev.conf like this: input { file { path => ["/tmp/catalina.jsonevent.log"] codec => json { charset => "UTF-8" } } } output { # Use stdout in debug mode again to see what logstash makes of the event. stdout { debug => true } elasticsearch_http { host => "127.0.0.1" } } And it jumps with this error: Exception in thread "LogStash::Runner" org.jruby

Bundle failing on JRuby with “TypeError: can't convert Regexp into String”

时光毁灭记忆、已成空白 提交于 2019-12-13 01:20:05
问题 I've deployed a new server that has the exact same version of JRuby (1.7.22), Java (openjdk-7-jre-headless 7u51), and bundler as the other servers. Both servers are running Ubuntu 14.04, but the new one has some newer packages. I deployed the same version of the project using Capistrano to the new server. When Capistrano runs bundle (or when I do it myself), the following error and callstack are presented: TypeError: can't convert Regexp into String end_with? at org/jruby/RubyString.java:5281

Warbler not including ActiveSupport locale files

半腔热情 提交于 2019-12-13 01:08:22
问题 I am using Rails 3.1.3, JRuby 1.7.6, and Warbler 1.3.8 Note This was not happening when using JRuby 1.6.7 - but we recently tried to update the JRuby version, and that is when this issue started. We use Warbler to package our ruby on rails application into a WAR file. That process pre-compiles all the assets and everything works fine (seems to work fine, the command is successful) We then deploy the WAR file with our Software (which uses a JRuby environment - 1.7.6 - and uses Jetty as a web

Jruby and Cucumber / Cucumber Rails - Could not find generator cucumber:install

醉酒当歌 提交于 2019-12-12 14:35:46
问题 Although I've often come here for solutions, however this is my first post! Problem: When trying to run "rails generate cucumber:install" I receive the error: Could not find generator cucumber:install Note: When using plain Ruby on Windows I have managed to successfully configure cucumber, but had to change because of the dependency on java libraries and requirement for Jruby... Background: Setting up a testing pc that requires Windows and Java 6. Using Windows XP Downloaded and installed

SASS is prepending unicode content with backslash (\)

♀尐吖头ヾ 提交于 2019-12-12 10:48:40
问题 Problem I'm trying to produce some unicode characters after compiling my *.scss file. As an example, I have the following (SCSS): .element:after { content: "\a0"; } When the file is compiled, it outputs the following (CSS): .element:after { content: "\\a0"; } Notice the extra unwanted backslash (\). Attempted Solution #1 I did try the solution here: Sass: unicode escape is not preserved in .css file, which suggests introducing the following function: @function unicode($str) { @return unquote(

Error: private method `gsub' called for nil:NilClass with pik install ruby 1.9.3

我的梦境 提交于 2019-12-12 09:57:14
问题 On Windows 7 machine, I have installed jruby 1.6.7 and then installed pik with 'gem install pik'. I then ran pik_install C:\bin which installed pik properly. I can run "pik ls" command properly. C:\Users\nir>pik ls * 167: jruby 1.6.7 (ruby-1.8.7-p357) (2012-02-22 3e82bc8) (Java HotSpot(TM)... My PATH is :- C:\Users\nir>echo %PATH% C:\Program Files\Java\jdk1.7.0\bin; C:\bin;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\jruby-1.6.7\bin;C:

Faster RSpec with JRuby

纵然是瞬间 提交于 2019-12-12 07:46:19
问题 I'm pretty new to the whole JRuby world. I'm using RSpec on a pretty big test suite. I'd like to be able to run the specs frequently but the JVM takes so long to startup it's becoming a real time drain. Is there a way to keep the JVM running? or a way to get specs to run faster with JRuby? 回答1: There are two things you could look into: Run a nailgun server and send spec runs to it. jruby --ng-server & and then jruby --ng -S spec or jruby --ng -S rake Use spork. http://www.ruby-forum.com/topic

require self made gem in jruby fails after update to jruby-1.7.13

ぃ、小莉子 提交于 2019-12-12 07:28:43
问题 I used jruby-1.7.0 and testing frame work Test::Unit::TestCase. Now I have updated some gems which caused me to use MiniTest::Test for testing, so I also upgraded to jruby-1.7.13. I have a rake task too which builds my gems with java *.class files instead of ruby *.rb files. Now many things dont work any more like 'rake test', or require "my_gem_xyz" from irb, getting errors like load error and ArrayIndexOutOfBoudsException. I have rvm installed to switch between rubies. How can I use *.class

JRuby installation failing unless sudo with “undefined local variable or method `r' for main:Object”

大憨熊 提交于 2019-12-12 05:13:52
问题 UPDATE: everything works when I use sudo (e.g. sudo rbenv install jruby-9.1.2.0 ). But I don't want that :). $ ruby -v NameError: undefined local variable or method `v' for main:Object <top> at -v:1 $ sudo ruby -v jruby 9.1.2.0 (2.3.0) 2016-05-26 7357c8f Java HotSpot(TM) 64-Bit Server VM 25.51-b03 on 1.8.0_51-b16 +jit [darwin-x86_64] Looking for hints on where to look for what thing(s) are requiring sudo during the installation. C Ruby installs/runs just fine without sudo . Trying to install