-
Notifications
You must be signed in to change notification settings - Fork 28
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Rails migration failure - Java::JavaLang::NoSuchMethodError: org.jruby.RubyEncoding.newEncoding #31
Comments
The error was because I didn't set a default value for not null constraint. This is still an issue, but only an issue in how the error is rendered |
Thanks @cavneb for reporting this issue. what version of jruby are you using ? |
FWIW, I’m also seeing this whenever an error is rendered in jruby-9.1.1.0. |
I don't think this issue should be closed. The useful error information is lost and NoSuchMethodError is a heavy Throwable that many processes would consider cause to abort the process (as opposed to an Exception). |
This is happening for every postgres error I see in jruby-9.2.8.0 as well. |
I have a Rails app that we converted to use jRuby, along with this gem.
I have a simple migration:
class AddSummarizedOnWithOffsetToTwitterEngagements < ActiveRecord::Migration def change add_column :twitter_post_engagements, :summarized_on_with_offset, :date, null: false add_column :twitter_daily_post_engagements, :summarized_on_with_offset, :date, null: false end end
When running the migration, I get the following convoluted error:
== 20160128152848 AddSummarizedOnWithOffsetToTwitterEngagements: migrating ==== -- add_column(:twitter_post_engagements, :summarized_on_with_offset, :date, {:null=>false}) /Users/eric.berry/.rbenv/versions/jruby-9.0.4.0/lib/ruby/gems/shared/gems/rake-10.5.0/lib/rake/task.rb:189: warning: singleton on non-persistent Java type Java::JavaLang::NoSuchMethodError (http://wiki.jruby.org/Persistence) rake aborted! Java::JavaLang::NoSuchMethodError: org.jruby.RubyEncoding.newEncoding(Lorg/jruby/Ruby;Lorg/jcodings/Encoding;)Lorg/jruby/RubyEncoding; org.jruby.pg.Connection.newPgErrorCommon(Connection.java:1434) org.jruby.pg.Connection.newPgError(Connection.java:1450) org.jruby.pg.Result.check(Result.java:107) org.jruby.pg.Connection.exec(Connection.java:549) org.jruby.pg.Connection$INVOKER$i$0$2$exec_DBG.call(Connection$INVOKER$i$0$2$exec_DBG.gen) org.jruby.internal.runtime.methods.DynamicMethod.call(DynamicMethod.java:201) org.jruby.internal.runtime.methods.DynamicMethod.call(DynamicMethod.java:197) org.jruby.internal.runtime.methods.AliasMethod.call(AliasMethod.java:61) org.jruby.runtime.callsite.CachingCallSite.call(CachingCallSite.java:161) org.jruby.ir.interpreter.InterpreterEngine.processCall(InterpreterEngine.java:290) org.jruby.ir.interpreter.StartupInterpreterEngine.interpret(StartupInterpreterEngine.java:77) org.jruby.ir.interpreter.Interpreter.INTERPRET_BLOCK(Interpreter.java:122) org.jruby.runtime.MixedModeIRBlockBody.commonYieldPath(MixedModeIRBlockBody.java:136) org.jruby.runtime.IRBlockBody.yieldSpecific(IRBlockBody.java:67) org.jruby.runtime.Block.yieldSpecific(Block.java:116) org.jruby.ir.runtime.IRRuntimeHelpers.yieldSpecific(IRRuntimeHelpers.java:457) org.jruby.ir.instructions.YieldInstr.interpret(YieldInstr.java:72) org.jruby.ir.interpreter.StartupInterpreterEngine.processOtherOp(StartupInterpreterEngine.java:191) org.jruby.ir.interpreter.StartupInterpreterEngine.interpret(StartupInterpreterEngine.java:115) org.jruby.ir.interpreter.Interpreter.INTERPRET_BLOCK(Interpreter.java:122) org.jruby.runtime.MixedModeIRBlockBody.commonYieldPath(MixedModeIRBlockBody.java:136) org.jruby.runtime.IRBlockBody.doYield(IRBlockBody.java:152) org.jruby.runtime.BlockBody.yield(BlockBody.java:78) org.jruby.runtime.Block.yield(Block.java:147) ...
I am currently running postgres 9.5 on my local machine, however this error also happens on our prod server, which is running 9.4.
Thank you for your help!
The text was updated successfully, but these errors were encountered: