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
Related
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.
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'm new to programming and rails so please forgive any big oversights. I recently deployed a rails app to heroku and switched all environments to postgres for my db. It is up on heroku working just fine with Postgres - ran rake db:drop db:migrate db:create db:seed all to populate my database with a rake task, tested the apps search forms, filters, data queries, etc. and it all worked well.
But I am now getting an error that says "comparison of ActiveSupport::SafeBuffer with nil failed" in the browser after firing up my local server and going to two of my views that have sorts - the browser is pointing me to a line in a view that has
<% #price_array.sort! {|x,y| x <=> y} %>
This is what I see in the server log:
Rendered skis/index.html.erb within layouts/application (212.9ms)
Completed 500 Internal Server Error in 280ms
ActionView::Template::Error (comparison of ActiveSupport::SafeBuffer with nil failed):
51: <% ski.inventories.each do |inventory| %>
52: <% a.push(number_to_currency(inventory.price)) %>
53: <% end %>
54: <% #lowest_price = a.sort { |x,y| x <=> y} %>
55: from <%= #lowest_price.first %>
56: </br>
57: </li>
app/views/skis/index.html.erb:54:in `sort'
app/views/skis/index.html.erb:54:in `block in_app_views_skis_index_html_erb___2303745325449705978_70146899313600'
app/views/skis/index.html.erb:32:in `each'
app/views/skis/index.html.erb:32:in `_app_views_skis_index_html_erb___2303745325449705978_70146899313600'
app/controllers/skis_controller.rb:32:in `index'
This may be related to the issue I am in running into - I cannot seem to drop my postgres database.
This is what I'm seeing in the terminal with postgres:
postgres=# \dbdrop postgres
List of tablespaces
Name | Owner | Location
------+-------+----------
(0 rows)
One other thing I did last night was update my .bash_profile per the instructions found here (http://stackoverflow.com/questions/6770649/repairing-postgresql-after-upgrading-to-osx-10-7-lion). This is what my .bash_profile looks like now:
[[ -s "$HOME/.rvm/scripts/rvm" ]] && . "$HOME/.rvm/scripts/rvm" # Load RVM function
PATH=/usr/local/bin:$PATH
Is there some configuration in postgres that I am missing that is causing this error? Any help or resources would be appreciated. Thanks.
you have nil values in your a array. Try :
a.compact.sort
compact removes all occurences of nil in your array.
I'm setting up a working application on a new environment, and after running 'bundle install' I try to launch an application.
And I get a following error:
ActionView::Template::Error (compile error
D:/Dev_apps/Ruby187/lib/ruby/gems/1.8/gems/activerecord-3.1.0.rc5/lib/active_record/attribute_methods/read.rb:85: syntax error, unexpected kEND
D:/Dev_apps/Ruby187/lib/ruby/gems/1.8/gems/activerecord-3.1.0.rc5/lib/active_record/attribute_methods/read.rb:87: syntax error, unexpected $end, expecting kEND):
6: <nav class="round">
7:
8: <ul>
9: <% if can? :browse_backend, current_user %>
10: <li><%= link_to "Админка", admin_root_path %></li>
11: <% end %>
12:
app/models/user.rb:60:in `has_role?'
app/models/ability.rb:14:in `initialize'
app/views/layouts/_header.html.erb:9:in `_app_views_layouts__header_html_erb___239100443_122539296'
app/views/layouts/application.html.erb:16:in `_app_views_layouts_application_html_erb__144136837_122749020'
What I can't understand is how can that happen in a gem.
I got this error when I upgraded my app to rails 3.1 and I was able to fix it by installing a more recent version of the mysql2 gem (I installed 0.3.7).
The problem is in your code but since the gems use your code to do their magic it seems like the error comes from the gem.
Check your user.rb file at line 60. You might have a syntax error around there.