-
Notifications
You must be signed in to change notification settings - Fork 30
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
#<NoMethodError: undefined method `layout_scene' for #<Java::JavafxStage::Stage:0x5eea82fc>> #24
Comments
huh, thats odd. are you sure all the files in core_ext are in the jar? Only other suggestion is why are you calling |
Thats actually just code I copied from one of the samples. Except that when I got this error the first few times, I changed it to an explicit call on stage to see if that made a difference which it didn't. Same error. But yeah, definitely checked and the files are in there, including stage.rb where that method is defined. |
yea I know where it came from, I ported that sample to JRubyFX 😀 hmm, put a |
Hah. Nice work on that, I always thought that was a pretty demo from GroovyFX, ScalaFX, etc. Was happy to see JRubyFX in those brilliant gradients. So after all our tail-chasing earlier, lol, finally got a chance to look back at this. I added def self.load_dsl
rt = "#{File.dirname(__FILE__)}/core_ext"
Dir.glob("#{rt}/*.rb") do |file|
puts "Before require" # See if the block is running at all
require file
puts file # See if the require itself is messing up
end Rebuilding the jar and then just using it to run the file works fine, and we get a bunch of output like:
But when I try using the javafx Launcher again, back to that error:
Gotta get some sleep here, but wanted to get this recorded. BTW, that error was the only output. Nothing from our puts statements. |
Fixed in PR #27 |
So, I've been doing some experiments the past few days trying to figure out the webstart stuff, and in doing so hit upon a weird bug. If I have a jruby-complete.jar with jrubyfx copied in, I can certainly run jrubyfx apps with it like:
java -jar jruby-complete.jar hello.rb
and it works like a charm. But given the same jar, let's say I have this ruby class:And try to call it from a launcher like this:
Then I get the following error:
Ignore that I'm probably doing all sorts of horrible things with this code, since it's just experimental, but for whatever reason, in this situation,
layout_scene
(and perhaps other parts of the DSL, I don't know yet) vanish. The very same java launcher is perfectly capable of launching other far more complex JRubyFX apps, that use FXML and CSS, but toss inlayout_scene
and it breaks down. Just thought I'd get this in while it was fresh in mind. Thanks. Seems like at some point, scripting existing javafx apps with jrubyfx might be an interesting use case, so thought it would be worth mentioning that this happens.(Still haven't gotten webstart/jnlp working, but I think I'm starting to get useful errors finally so that's always a good sign).
The text was updated successfully, but these errors were encountered: