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.
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.
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?
I'm upgrading ruby, rails and the other gems of an old application built on ruby2 running on Heroku.
I made it to deploy to Heroku but HTTP ERROR 500 occurs.
the error log is this below
ActionView::Template::Error (login.js):
40: = image_tag "app_logo.png", id: "app_logo", alt: "app"
41:
42: %span#dest
43: = javascript_include_tag "login"
app/views/sessions/_login.html.haml:43
app/views/sessions/login.html.haml:1
When I commented out this part = javascript_include_tag "login"
no error is emitted but also nothing appeared on the application page.
If anyone have any idea to solve it share with me please.
thanks
Your HAML code can be translated like this :
%span#dest
= javascript_include_tag "login"
<span id="dest">
<script src="/assets/login.js"></script>
</span>
The error means that your application failed to load the /assets/login.js.
You should look there what have messed up.
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'm deploying a Rails 3.2 app to Heroku. I'm precompiling assets locally as per https://devcenter.heroku.com/articles/rails3x-asset-pipeline-cedar.
But I'm getting
ActionView::Template::Error (devise/sessions.js isn't precompiled):
Has anyone else encountered this?
What is the correct way to ensure Devise javascripts are precomiled.
Thanks!
Thank you for all the suggestions. After a bit of thinking, I realize that the issue was down to how the app was configured to call controller-specific javascript. IN case anyone else runs into this issue, here's what I did.
I had been loading controller-specific .js via the following tag in the layout file.
<%= javascript_include_tag "application", params[:controller] %>
Problem is, this fails if a particular cotroller.js file does not exist. In my case, the login page failed as I had not created a devise/sessions.js file.
I could have created this file, but I felt this was a messy approach. I don't like the idea of having a lot of empty files lying around.
Instead I am explicitly calling controller-specific javascripts from the view
<% javascript 'controller.js' %>
Using the following helper in application_helpers
def javascript(*files)
content_for(:head) { javascript_include_tag(*files) }
end
Seems to be working fine so far.
Thanks again for the suggestions.
My solution:
<%= javascript_include_tag "application", controller_name if controller_name != "sessions" %>
Try running rake assets:precompile.
Try adding this to your config/environments/production.rb :
config.assets.precompile += %w( *.css *.js )
Or specify your file.