Comments (11)
Can you get the backtrace for the error?
from roda.
here you go:
remote: /tmp/build_9f193afe940ec1cab65aa0020ab8699c/vendor/bundle/ruby/2.1.0/gems/tilt-1.4.1/lib/tilt/template.rb:91:in `initialize'�
remote: /tmp/build_9f193afe940ec1cab65aa0020ab8699c/vendor/bundle/ruby/2.1.0/gems/tilt-1.4.1/lib/tilt/template.rb:91:in `open'�
remote: /tmp/build_9f193afe940ec1cab65aa0020ab8699c/vendor/bundle/ruby/2.1.0/gems/tilt-1.4.1/lib/tilt/template.rb:91:in `read_template_file'�
remote: /tmp/build_9f193afe940ec1cab65aa0020ab8699c/vendor/bundle/ruby/2.1.0/gems/tilt-1.4.1/lib/tilt/template.rb:68:in `block in initialize'�
remote: /tmp/build_9f193afe940ec1cab65aa0020ab8699c/vendor/bundle/ruby/2.1.0/gems/tilt-1.4.1/lib/tilt/template.rb:69:in `call'�
remote: /tmp/build_9f193afe940ec1cab65aa0020ab8699c/vendor/bundle/ruby/2.1.0/gems/tilt-1.4.1/lib/tilt/template.rb:69:in `initialize'�
remote: /tmp/build_9f193afe940ec1cab65aa0020ab8699c/vendor/bundle/ruby/2.1.0/gems/tilt-1.4.1/lib/tilt.rb:61:in `new'�
remote: /tmp/build_9f193afe940ec1cab65aa0020ab8699c/vendor/bundle/ruby/2.1.0/gems/tilt-1.4.1/lib/tilt.rb:61:in `new'�
remote: /tmp/build_9f193afe940ec1cab65aa0020ab8699c/vendor/bundle/ruby/2.1.0/gems/roda-2.4.0/lib/roda/plugins/render.rb:324:in `block in retrieve_template'�
remote: /tmp/build_9f193afe940ec1cab65aa0020ab8699c/vendor/bundle/ruby/2.1.0/gems/roda-2.4.0/lib/roda/plugins/render.rb:235:in `cached_template'�
remote: /tmp/build_9f193afe940ec1cab65aa0020ab8699c/vendor/bundle/ruby/2.1.0/gems/roda-2.4.0/lib/roda/plugins/render.rb:315:in `retrieve_template'�
remote: /tmp/build_9f193afe940ec1cab65aa0020ab8699c/vendor/bundle/ruby/2.1.0/gems/roda-2.4.0/lib/roda/plugins/render.rb:200:in `render'�
remote: /tmp/build_9f193afe940ec1cab65aa0020ab8699c/vendor/bundle/ruby/2.1.0/gems/roda-2.4.0/lib/roda/plugins/assets.rb:645:in `render_asset_file'�
remote: /tmp/build_9f193afe940ec1cab65aa0020ab8699c/vendor/bundle/ruby/2.1.0/gems/roda-2.4.0/lib/roda/plugins/assets.rb:617:in `read_asset_file'�
remote: /tmp/build_9f193afe940ec1cab65aa0020ab8699c/vendor/bundle/ruby/2.1.0/gems/roda-2.4.0/lib/roda/plugins/assets.rb:423:in `block in compile_assets_files'�
remote: /tmp/build_9f193afe940ec1cab65aa0020ab8699c/vendor/bundle/ruby/2.1.0/gems/roda-2.4.0/lib/roda/plugins/assets.rb:420:in `map'�
remote: /tmp/build_9f193afe940ec1cab65aa0020ab8699c/vendor/bundle/ruby/2.1.0/gems/roda-2.4.0/lib/roda/plugins/assets.rb:420:in `compile_assets_files'�
remote: /tmp/build_9f193afe940ec1cab65aa0020ab8699c/vendor/bundle/ruby/2.1.0/gems/roda-2.4.0/lib/roda/plugins/assets.rb:408:in `_compile_assets'�
remote: /tmp/build_9f193afe940ec1cab65aa0020ab8699c/vendor/bundle/ruby/2.1.0/gems/roda-2.4.0/lib/roda/plugins/assets.rb:405:in `block in _compile_assets'�
remote: /tmp/build_9f193afe940ec1cab65aa0020ab8699c/vendor/bundle/ruby/2.1.0/gems/roda-2.4.0/lib/roda/plugins/assets.rb:405:in `each_key'�
remote: /tmp/build_9f193afe940ec1cab65aa0020ab8699c/vendor/bundle/ruby/2.1.0/gems/roda-2.4.0/lib/roda/plugins/assets.rb:405:in `_compile_assets'�
remote: /tmp/build_9f193afe940ec1cab65aa0020ab8699c/vendor/bundle/ruby/2.1.0/gems/roda-2.4.0/lib/roda/plugins/assets.rb:379:in `compile_assets'�
remote: /tmp/build_9f193afe940ec1cab65aa0020ab8699c/tasks/assets.rake:5:in `block (2 levels) in <top (required)>'�
from roda.
I can't reproduce this locally. If I add a call Roda.compile_assets
after loading the plugin in that example, it works fine and serves the compiled assets.
This doesn't appear to be a bug in Roda, so I'm closing this now. If you still think it is an issue with roda-opal-example
, you may want to open up an issue there, and you'll probably want to add more detail, like what changes you have made, whether it works without compilation, versions of software in use, etc..
from roda.
It works without pre-compiling. It only fails when running pre-compile. I'll try to come up with something so you can re-create it. Thank you for looking into it thus far.
from roda.
@jeremyevans so it appears the issue is grabbing files outside of the directory root on compile (i.e. in a gem). It finds the file just fine when it doesn't need to compile.
from roda.
The assets plugin only supports asset files that are under the directory root, or at least, it wasn't designed to support external asset files. Those asset files may load files outside the directory root, if the template engine supports it (opal does).
If you can create a reproducible example, I'll take a look, but you should probably post it on the Google Group and not here, unless you are sure it is a bug in Roda itself.
from roda.
@jeremyevans I'll put together something and post on the google group. thanks again!
from roda.
@jeremyevans ok, I've opened a google group post and a message on how to re-create the issue. https://groups.google.com/forum/#!topic/ruby-roda/brNjNkfxRZo
from roda.
@jeremyevans I think this ticket should be opened again as a bug. If the desired purpose of pre-compile is not to allow outside assets to be compiled, when running an application without pre-compiling the assets, it should not load/throw the same error; otherwise people will make the same mistake I did and expect it to compile just fine.
from roda.
Honestly, I'm not sure why it works in non-compiled mode, I would expect it to fail there as well. This is definitely not a bug, it was never intended to work with files outside the asset path, you were just getting lucky that it was working in non-compiled mode.
Serving regular assets and compiling assets use the same code path (#read_asset_file/render_asset_file), so I'm very surprised the behavior is different. The only thing I can think that would cause this is something modifying render behavior that is different at runtime than when you are compiling (and that would be a bug in the app, not in Roda).
If you can create a minimal self-contained example (not using wedge), I'll take a deeper look.
from roda.
That line in roda-opal-example
just modifies the opal load path, not Roda's load path. If I uncomment the roda-opal-example
line, it does fail in both compiled and non-compiled mode, but that's due to the Opal error, not due to a Roda issue:
! Unable to load application: Opal::Builder::MissingRequire: A file required by "/home/jeremy/code/roda-opal-example/assets/js/test.rb" wasn't found.
can't find file: "opal/jquery" in ["/usr/local/lib/ruby/gems/2.2/gems/opal-0.8.0/opal", "/usr/local/lib/ruby/gems/2.2/gems/opal-0.8.0/stdlib", "/usr/local/lib/ruby/gems/2
.2/gems/opal-0.8.0/lib", "/home/jeremy/code/roda-opal-example/assets/js"]
Note that if you don't clear your browser cache, it may work in non-compiled mode as Roda will use a 304 response instead of rendering the asset, since the modified time of the asset file hasn't changed.
from roda.
Related Issues (20)
- opts[:root] not be set after start server. HOT 3
- Envrionments plugin: provide instance methods too? HOT 1
- How can i load coffeescript in roda HOT 2
- How to use common_logger plugin to log information in routes implementation or in specs or other place in the application? HOT 6
- [feature request] Make the view method (from the render plugin) accept a block like the render method does HOT 1
- route_csrf incompatible with rack-protection authenticity token checks HOT 5
- Unfork HOT 3
- env['rack.errors'] parsed as a link in common_logger plugin documentation HOT 2
- String matcher in hash_routes combined with unescape_path does not match non-ascii strings HOT 1
- [Documentation / Question] Request for a FAQ for experienced sinatra users HOT 1
- Raises "Unsupported block result" when using Unreloader and json plugin HOT 2
- On app startup. Getting message > Rack::Handler is deprecated and replaced by Rackup::Handler HOT 2
- Not compatible with Haml >= 6 HOT 2
- URI Unicode handling HOT 6
- Duplicating Content-Type header when header key comes in lowercase HOT 3
- json plugin does not support FalseClass and String anymore HOT 1
- Can gRPC services and clients be integrated?
- Unicode escapes not decoded in path HOT 3
- Sanitize params when using plugin `error_mail` HOT 2
- Missing rackup on clean install HOT 4
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 roda.