Skip to content
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

java.lang.NoSuchMethodError: org.jruby.RubyEncoding.newEncoding #35

Closed
jg opened this issue Aug 13, 2016 · 7 comments
Closed

java.lang.NoSuchMethodError: org.jruby.RubyEncoding.newEncoding #35

jg opened this issue Aug 13, 2016 · 7 comments

Comments

@jg
Copy link

jg commented Aug 13, 2016

(switched to jruby-9.0.0.0 recently)

I'm getting the following error when running a pretty simple migration in sequel:

Connection.java:1434:in `newPgErrorCommon': java.lang.NoSuchMethodError: org.jruby.RubyEncoding.newEncoding(Lorg/jruby/Ruby;Lorg/jcodings/Encoding;
)Lorg/jruby/RubyEncoding;
        from Connection.java:1450:in `newPgError'
        from Result.java:107:in `check'
        from Connection.java:549:in `exec'
        from Connection$INVOKER$i$0$2$exec.gen:-1:in `call'
        from DynamicMethod.java:205:in `call'
        from DynamicMethod.java:201:in `call'
        from AliasMethod.java:61:in `call'
        from CachingCallSite.java:161:in `call'
        from InterpreterEngine.java:289:in `processCall'
        from StartupInterpreterEngine.java:77:in `interpret'
        from Interpreter.java:136:in `INTERPRET_BLOCK'
        from InterpretedIRBlockBody.java:118:in `commonYieldPath'
        from IRBlockBody.java:66:in `yieldSpecific'
        from Block.java:116:in `yieldSpecific'
        from IRRuntimeHelpers.java:457:in `yieldSpecific'
        from YieldInstr.java:72:in `interpret'
        from StartupInterpreterEngine.java:183:in `processOtherOp'
        from StartupInterpreterEngine.java:107:in `interpret'
        from MixedModeIRMethod.java:128:in `INTERPRET_METHOD'
        from MixedModeIRMethod.java:114:in `call'
        from CachingCallSite.java:273:in `cacheAndCall'
        from CachingCallSite.java:79:in `callBlock'
        from CachingCallSite.java:83:in `call'
        from CallBase.java:419:in `interpret'
        from InterpreterEngine.java:321:in `processCall'
        from StartupInterpreterEngine.java:77:in `interpret'
        from MixedModeIRMethod.java:128:in `INTERPRET_METHOD'
        from MixedModeIRMethod.java:114:in `call'
        from CachingCallSite.java:77:in `callBlock'
        from CachingCallSite.java:83:in `call'
        from CallBase.java:419:in `interpret'
        from InterpreterEngine.java:321:in `processCall'
        from StartupInterpreterEngine.java:77:in `interpret'
        from Interpreter.java:136:in `INTERPRET_BLOCK'
        from InterpretedIRBlockBody.java:118:in `commonYieldPath'

The migration is:

Sequel.migration do
  change do
    alter_table(:offers) do
      add_column(:size, Integer)
      add_column(:title, String)
      add_column(:description, String)
      add_column(:construction_year, String)
      add_column(:insertion_date, String)
      add_column(:lat, Float)
      add_column(:lng, Float)
      add_column(:street, String)
      add_column(:price, Integer)
      add_column(:price_per_meter, Float)
      add_column(:rooms, Integer)
      add_column(:floor_number, Integer)
      add_column(:max_floor, Integer)
      add_column(:insertion_date, DateTime)
      add_column(:is_active, TrueClass)
    end
  end
end
@jg
Copy link
Author

jg commented Aug 13, 2016

ah, so it fails because of the duplicate column name in the migration & gives out that uninformative error?

@qnet-herwin
Copy link

It fails as soon as it tries to raise an PG::Exception. Simple reproduction

conn = PG::Connection.new(...)
conn.exec('SELECT * FROM this_table_does_not_exist')

It looks like #32 would fix this

@headius
Copy link
Owner

headius commented May 9, 2017

Fixed in 9cc73de.

@headius headius closed this as completed May 9, 2017
@erikogan
Copy link

erikogan commented May 9, 2017

I just cloned the repo to see if I could add tests for #32 to help get it merged. I was confused when looking at the merge conflict between master and his old branch.

Thanks @headius!

@headius
Copy link
Owner

headius commented May 9, 2017

@erikogan Note that I also released a jruby-pg gem, finally. Hopefully we can get this project going again.

@erikogan
Copy link

erikogan commented May 9, 2017

@headius Thanks, I missed the name change. I was wondering how this would work with my project using pg_jruby 0.17.1. I’ve switched to jruby-pg 0.1. I’ll let you know if I see any issues.

@edmondhc
Copy link

@erikogan Were you able to deal with this issue?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants