Comments (5)
huh, thats odd. are you sure all the files in core_ext are in the jar? Only other suggestion is why are you calling stage.layout_scene(500, 250, :black)
? The with() function makes it implicit: layout_scene(500, 250, :black)
from jrubyfx.
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.
from jrubyfx.
yea I know where it came from, I ported that sample to JRubyFX
hmm, put a puts "hey I was included!"
in stage.rb and make sure its called. alternatively, puts file
on line 232 of dsl.rb and make sure all extensions are loaded.
from jrubyfx.
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 puts "hey I was included!"
at the bottom of stage.rb, then for good measure, also went into dsl.rb and added it like this:
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:
java -jar jruby-log.jar hello.rb
Before require
file:/home/eric/projects/jrubyfx_projects/jrubyfx_web/jruby-log.jar!/jrubyfx/core_ext/radial_gradient.rb
Before require
file:/home/eric/projects/jrubyfx_projects/jrubyfx_web/jruby-log.jar!/jrubyfx/core_ext/drag_event.rb
Before require
...
file:/home/eric/projects/jrubyfx_projects/jrubyfx_web/jruby-log.jar!/jrubyfx/core_ext/node.rb
Before require
hey I was included!
...
But when I try using the javafx Launcher again, back to that error:
Exception running Application:
#<NoMethodError: undefined method `layout_scene' for #<Java::JavafxStage::Stage:0x2e61b072>>
/home/eric/projects/jrubyfx_projects/jrubyfx_web/hello.rb:10:in `start'
org/jruby/RubyBasicObject.java:1691:in `instance_eval'
jar:file:/home/eric/projects/jrubyfx_projects/jrubyfx_web/jruby-log.jar!/jrubyfx/fxml_module.rb:49:in `with'
/home/eric/projects/jrubyfx_projects/jrubyfx_web/hello.rb:6:in `start'
jar:file:/home/eric/projects/jrubyfx_projects/jrubyfx_web/jruby-log.jar!/jrubyfx/java_fx_impl.rb:121:in `launch_app_after_platform'
org/jruby/gen/InterfaceImpl676239127.gen:13:in `run'
Gotta get some sleep here, but wanted to get this recorded.
BTW, that error was the only output. Nothing from our puts statements.
from jrubyfx.
Fixed in PR #27
from jrubyfx.
Related Issues (20)
- jrubyfx sensitive to number of spaces in fxml HOT 2
- Enhancement: Provide Ruby binding impls HOT 1
- Setting TableView items doesn't seem to work HOT 4
- Jar classpath issue on windows HOT 1
- jarify with fxml: no .jrubyfx_cache in the jarfile HOT 1
- jarify with fxml: cannot access the fxml files
- jarify with fxml: require_relative doesn't work from inside a jarfile
- jrubfx-jarify compiled jar does not laucnch HOT 5
- cannot run the hello world app HOT 2
- gem install jrubyfx gem not found HOT 1
- Permission denied for 'jrubyfx_cache' HOT 2
- Need more documentation for controller functions HOT 1
- jrubyfx não encaminhando HOT 2
- Is this project active ? HOT 3
- Path to jfxrt.jar loading issue with 1.8.0_202-ea-b03 HOT 1
- Would it be possible to add a screenshot-example to the main README here? HOT 1
- Use javafx 17 modules HOT 3
- Warning: SCENE3D? HOT 1
- More examples perhaps? TextArea specifically
- Classic OOP style? HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from jrubyfx.