I have an app that supposed to generate PDFs with a gem called wicked_pdf. When I try to invoke it, I get an error. The logs give a hint of the problem:
ActionView::Template::Error (The asset "qr-code.js" is not present in the asset pipeline.
):
1: <%= javascript_pack_tag 'qrcode' %>
2: <%= wicked_pdf_javascript_include_tag "qr-code" %>
3:
4: <%=wicked_pdf_stylesheet_link_tag 'pdf' %>
5: <p id="notice"><%= notice %></p>
app/views/health_cards/show.pdf.erb:2
app/controllers/health_cards_controller.rb:21:in `block (2 levels) in show'
app/controllers/health_cards_controller.rb:12:in `show'
app/controllers/application_controller.rb:31:in `handle_fhir_errors'
However, I noticed that there is a file the application's javascript directory at:
./app/javascript/packs/qrcode.js
so I changed the include statement at line 2 above from qr-code to qrcode but it doesn't make a difference. Given the parent directory is called "packs", it looks like it could be doing some fancy caching somewhere. How can I rebuild my assets and/or fix the issue?
Related
I am running rails 6, and I have an application is working fine on my local, but when I tried to update the new version to the remote (railway), it doesn't build.
I've been in this issue for very long time, I've tried many work arounds, such as adding /assets/
I am getting the following error:
"ActionView::Template::Error (The asset "icons.css" is not present in the asset pipeline."
Following is my deploy log, some print screens and what I've tried already
[2023-02-10T19:39:55.261020 #1] INFO -- : [bf97bf74-3cf5-4085-a60a-4194f1935b1e] Completed 500 Internal Server Error in 1206ms (ActiveRecord: 92.9ms | Allocations: 59127)
F, [2023-02-10T19:39:55.262199 #1] FATAL -- : [bf97bf74-3cf5-4085-a60a-4194f1935b1e]
[bf97bf74-3cf5-4085-a60a-4194f1935b1e] ActionView::Template::Error (The asset "icons.css" is not present in the asset pipeline.
):
[bf97bf74-3cf5-4085-a60a-4194f1935b1e] 30: <meta name="twitter:creator" content="">
[bf97bf74-3cf5-4085-a60a-4194f1935b1e] 31: <meta name="twitter:image:src" content="<%= #trip && #trip.try(:id) && #trip.avatar.attached? ? #trip.try(:id) && #trip.try(:avatar).try(:service_url) : "#{get_site_image}" %>">
[bf97bf74-3cf5-4085-a60a-4194f1935b1e] 32:
[bf97bf74-3cf5-4085-a60a-4194f1935b1e] 33: <%= stylesheet_link_tag "icons.css", "data-turbo-track": "reload" %>
[bf97bf74-3cf5-4085-a60a-4194f1935b1e] 34: <%= stylesheet_link_tag "tooltipster.css", "data-turbo-track": "reload" %>
[bf97bf74-3cf5-4085-a60a-4194f1935b1e] 35: <%= stylesheet_link_tag "tooltipster-light.css", "data-turbo-track": "reload" %>
[bf97bf74-3cf5-4085-a60a-4194f1935b1e] 36: <%= stylesheet_link_tag "animations.css", "data-turbo-track": "reload" %>
[bf97bf74-3cf5-4085-a60a-4194f1935b1e]
[bf97bf74-3cf5-4085-a60a-4194f1935b1e] app/views/layouts/application.html.erb:33
here is my application file:
first part app file
second part app file
here is my package file:
package file
here us my webpack.yml file
webpack.yml
it runs locally fine, not on remote!
I've tried many many things:
recompiling with rake assets:precompile
adding /assets/ from line 33 to 58
removing line 59 "<%= javascript_pack_tag 'application', 'data-turbolinks-track': 'reload' %> "
Got many message errors from line 90 onwards "ActionController::RoutingError (No route matches [GET] "/assets/javascript/plugins/custom_onepage.js"):
[ac8248e6-f859-4969-9b54-9368bc3999cb]" so I cleared with rake assets:clobber
When I've done that, I start to get "ActionController::RoutingError (No route matches [GET] "/assets/font-awesome.min.css")" for every single line i've added /assets/ in the beginning
Tried to remove the /assets/ and recompile again, still not working and I got stuck again on line 33.
does anyone know how can find an workaround? I've tried many things and I been stuck for 4 days
So I was using railway, and I've tried to start the building proccess by adding the command NODE_OPTIONS --openssl-legacy-provider, but although having set this command to start building it, it hasn't sorted any effect.
So after reading loads of threads and tried almost everything, I find out that I had to add that as an env from my project NODE_OPTIONS=openssl-legacy-provider then I've got everything working.
Everything is working perfectly locally but when I tried to put the app live I've got this error:
Showing /home/rails/app/views/layouts/application.html.erb where line #9 raised:
end of file reached
(in /home/rails/app/assets/stylesheets/global.css.scss)
this is line 9
<%= stylesheet_link_tag "application" %>
when I remove this line I get errors for javascript:
<%= javascript_include_tag "vendor/modernizr" %>
What is the issue and how can it be fixed?
Also not sure about the "end of file reached global.css.scss?"
below is this:
app/views/layouts/application.html.erb:9:in `_app_views_layouts_application_html_erb__92412405316489023_40891780'
app/controllers/site_controller.rb:42:in `index'
On line 42 is the word "render"
def index
render
end
Many thanks
It should have something to do with precompile. Try cleaning the asset precompile temp folder.
If that doesn't solve it, pl post the stack trace.
I accidentally put a bad flash statement in my Redmine Plugin, and now my entire Redmine is trashed. No matter what I do, I get the following invincible error message:
ActionView::Template::Error (undefined method `html_safe' for
:value:Symbol):
54: <div id="sidebar">
55: <%= yield :sidebar %>
56: <%= view_layouts_base_sidebar_hook_response %>
57: </div>
58:
59: <div id="content">
60: <%= render_flash_messages %> app/helpers/application_helper.rb:316:in `block in
render_flash_messages' app/helpers/application_helper.rb:315:in
`render_flash_messages' app/views/layouts/base.html.erb:57:in
`_app_views_layouts_base_html_erb__1290735862753404915_23873920'
Fortunately, this exact problem has happened before
Unfortunately, none of the solutions proposed work for me, even though they worked for the guy who asked that question.
I generated a new secret key with the following command, taken straight from the Redmine tutorial:
bundle exec rake generate_secret_token
I restart the WEBrick server -- to no avail. I played around with the mentioned "rescue" item, but couldn't really figure out how to make it work.
Does anyone know how to fix this devastating bug?
FYI -- manually changing the key in:
config/initializers/secret_token.rb
slayed this deadly error
Firstly I'm still busy learning RoR so my understanding is limited. I created a new simple project and generated my first scaffold named 'Person'. When I start up my WEBrick server I go to localhost:3000/people I get the following runtime error:
ExecJS::RuntimeError in People#index
Showing C:/Users/Dean/Desktop/guestbook/app/views/layouts/application.html.erb where line #6 raised:
(in C:/Users/Dean/Desktop/guestbook/app/assets/javascripts/people.js.coffee)
Extracted source (around line #6):
3: <head>
4: <title>Guestbook</title>
5: <%= stylesheet_link_tag "application", :media => "all" %>
6: <%= javascript_include_tag "application" %>
7: <%= csrf_meta_tags %>
8: </head>
9: <body>
If any more clarification is needed please let me know and I'll gladly update my question.
I'm no expert but it looks like it's something to do with.. the coffeescript gem? I'm really just spitballin' here... Thanks in advance!
people.js.coffee:
# Place all the behaviors and hooks related to the matching controller here.
# All this logic will automatically be available in application.js.
# You can use CoffeeScript in this file: http://jashkenas.github.com/coffee-script/
ExecJS::RuntimeErrors are typically caused by syntax errors in your coffeescript. Check your people.js.coffee file around line 6 and make sure it is syntactically correct. If you are relatively unfamiliar with coffeescript, http://js2coffee.org/ converts between JS and coffee and might be helpful. .js.coffee files will only accept coffeescript.
I have an application which uses an engine (included by Gemfile gem my_engine, path=> '../my_engine'). It works nice with rails server. I decided to move it to nginx with passenger, but I get an error.
Sprockets::Helpers::RailsHelper::AssetPaths::AssetNotPrecompiledError
auth_engine.css isn't precompiled
Extracted source (around line #1):
1: <%= stylesheet_link_tag "auth_engine" %>
2:
3: <div class="form">
4: <% flash.each do |key, value| %>
auth_engine.css is located in my_engine/app/assets/stylesheets
How to fix this?
It looks like you're just linking to that one stylesheet separately instead of just letting rails roll into application.css. In that case, you should just move it to the public/assets/stylesheets folder to use it without compiling it.