mainio/decidim-module-term_customizer

500 Internal Server Error using module-term_customizer

Closed this issue · 2 comments

Hi.

I've installed decidim 0.19.1

 bundle info decidim
  * decidim (0.19.1)
	Summary: Citizen participation framework for Ruby on Rails.
	Homepage: https://github.com/decidim/decidim
	Path: /home/decidim/.rbenv/versions/2.6.3/lib/ruby/gems/2.6.0/gems/decidim-0.19.1

And module decidim-term_customizer

bundle info decidim-term_customizer
  * decidim-term_customizer (0.19.0)
	Summary: Provides possibility to customize Decidim's localized terms.
	Homepage: https://github.com/mainio/decidim-module-term_customizer
	Path: /home/decidim/.rbenv/versions/2.6.3/lib/ruby/gems/2.6.0/gems/decidim-term_customizer-0.19.0

I've followed carefully instructions provided on https://github.com/mainio/decidim-module-term_customizer

I've added on Gemfile

gem "decidim-term_customizer"

And I've executed:

bundle
bundle exec rails decidim_term_customizer:install:migrations
bundle exec rails db:migrate
bin/rails restart

But when we try to use this feature we get message:

Hi ha hagut un problema amb el nostre servidor

Reading production log file looks like:

I, [2020-01-20T02:34:27.581414 #11239]  INFO -- : [ae801d5f-d246-402e-9108-9a3f3ea23d19] Completed 500 Internal Server Error in 31ms (ActiveRecord: 1.8ms)
F, [2020-01-20T02:34:27.583068 #11239] FATAL -- : [ae801d5f-d246-402e-9108-9a3f3ea23d19]
F, [2020-01-20T02:34:27.583175 #11239] FATAL -- : [ae801d5f-d246-402e-9108-9a3f3ea23d19] ActionView::Template::Error (The asset "decidim/term_customizer/admin/translation_sets_admin.js" is not present in the asset pipeline.):
F, [2020-01-20T02:34:27.583314 #11239] FATAL -- : [ae801d5f-d246-402e-9108-9a3f3ea23d19]     6:   </div>
[ae801d5f-d246-402e-9108-9a3f3ea23d19]     7: <% end %>
[ae801d5f-d246-402e-9108-9a3f3ea23d19]     8:
[ae801d5f-d246-402e-9108-9a3f3ea23d19]     9: <%= javascript_include_tag "decidim/term_customizer/admin/translation_sets_admin" %>
F, [2020-01-20T02:34:27.583396 #11239] FATAL -- : [ae801d5f-d246-402e-9108-9a3f3ea23d19]
F, [2020-01-20T02:34:27.583501 #11239] FATAL -- : [ae801d5f-d246-402e-9108-9a3f3ea23d19] sprockets-rails (3.2.1) lib/sprockets/rails/helper.rb:83:in `compute_asset_path'
[ae801d5f-d246-402e-9108-9a3f3ea23d19] actionview (5.2.4.1) lib/action_view/helpers/asset_url_helper.rb:200:in `asset_path'
[ae801d5f-d246-402e-9108-9a3f3ea23d19] actionview (5.2.4.1) lib/action_view/helpers/asset_url_helper.rb:318:in `javascript_path'
[ae801d5f-d246-402e-9108-9a3f3ea23d19] actionview (5.2.4.1) lib/action_view/helpers/asset_tag_helper.rb:93:in `block in javascript_include_tag'
[ae801d5f-d246-402e-9108-9a3f3ea23d19] actionview (5.2.4.1) lib/action_view/helpers/asset_tag_helper.rb:92:in `map'
[ae801d5f-d246-402e-9108-9a3f3ea23d19] actionview (5.2.4.1) lib/action_view/helpers/asset_tag_helper.rb:92:in `javascript_include_tag'
[ae801d5f-d246-402e-9108-9a3f3ea23d19] sprockets-rails (3.2.1) lib/sprockets/rails/helper.rb:156:in `block in javascript_include_tag'
[ae801d5f-d246-402e-9108-9a3f3ea23d19] sprockets-rails (3.2.1) lib/sprockets/rails/helper.rb:154:in `map'
[ae801d5f-d246-402e-9108-9a3f3ea23d19] sprockets-rails (3.2.1) lib/sprockets/rails/helper.rb:154:in `javascript_include_tag'
[ae801d5f-d246-402e-9108-9a3f3ea23d19] decidim-term_customizer (0.19.0) app/views/decidim/term_customizer/admin/translation_sets/new.html.erb:9:in `__home_decidim__rbenv_versions_______lib_ruby_gems_______gems_decidim_term_customizer________app_views_decidim_term_customizer_admin_translation_sets_new_html_erb__399134481782619961_46980794651880'
[ae801d5f-d246-402e-9108-9a3f3ea23d19] actionview (5.2.4.1) lib/action_view/template.rb:159:in `block in render'
[ae801d5f-d246-402e-9108-9a3f3ea23d19] activesupport (5.2.4.1) lib/active_support/notifications.rb:170:in `instrument'
[ae801d5f-d246-402e-9108-9a3f3ea23d19] actionview (5.2.4.1) lib/action_view/template.rb:354:in `instrument_render_template'
[ae801d5f-d246-402e-9108-9a3f3ea23d19] actionview (5.2.4.1) lib/action_view/template.rb:157:in `render'
[ae801d5f-d246-402e-9108-9a3f3ea23d19] actionview (5.2.4.1) lib/action_view/renderer/template_renderer.rb:54:in `block (2 levels) in render_template'
[ae801d5f-d246-402e-9108-9a3f3ea23d19] actionview (5.2.4.1) lib/action_view/renderer/abstract_renderer.rb:44:in `block in instrument'
[ae801d5f-d246-402e-9108-9a3f3ea23d19] activesupport (5.2.4.1) lib/active_support/notifications.rb:168:in `block in instrument'
[ae801d5f-d246-402e-9108-9a3f3ea23d19] activesupport (5.2.4.1) lib/active_support/notifications/instrumenter.rb:23:in `instrument'
[ae801d5f-d246-402e-9108-9a3f3ea23d19] activesupport (5.2.4.1) lib/active_support/notifications.rb:168:in `instrument'
.
. 
.
ddleware.rb:29:in `call'
[ae801d5f-d246-402e-9108-9a3f3ea23d19] actionpack (5.2.4.1) lib/action_dispatch/middleware/executor.rb:14:in `call'
[ae801d5f-d246-402e-9108-9a3f3ea23d19] rack (2.1.1) lib/rack/sendfile.rb:113:in `call'
[ae801d5f-d246-402e-9108-9a3f3ea23d19] rack-cors (1.1.1) lib/rack/cors.rb:100:in `call'
[ae801d5f-d246-402e-9108-9a3f3ea23d19] railties (5.2.4.1) lib/rails/engine.rb:524:in `call'
[ae801d5f-d246-402e-9108-9a3f3ea23d19] /usr/lib/ruby/vendor_ruby/phusion_passenger/rack/thread_handler_extension.rb:97:in `process_request'
[ae801d5f-d246-402e-9108-9a3f3ea23d19] /usr/lib/ruby/vendor_ruby/phusion_passenger/request_handler/thread_handler.rb:149:in `accept_and_process_next_request'
[ae801d5f-d246-402e-9108-9a3f3ea23d19] /usr/lib/ruby/vendor_ruby/phusion_passenger/request_handler/thread_handler.rb:110:in `main_loop'
[ae801d5f-d246-402e-9108-9a3f3ea23d19] /usr/lib/ruby/vendor_ruby/phusion_passenger/request_handler.rb:415:in `block (3 levels) in start_threads'
[ae801d5f-d246-402e-9108-9a3f3ea23d19] /usr/lib/ruby/vendor_ruby/phusion_passenger/utils.rb:113:in `block in create_thread_and_abort_on_exception'
I, [2020-01-20T02:34:27.584812 #11239]  INFO -- : [ae801d5f-d246-402e-9108-9a3f3ea23d19] Processing by Decidim::ErrorsController#internal_server_error as HTML

So, what do we need for get working this feature?

Thanks!

Hmm, have you had an existing Decidim installation and then installed term customizer on top of it?

If so, can you try running the following command:

RAILS_ENV=<your env> bin/rails assets:precompile

Replace <your env> with the target environment.

If this doesn't work, I can look into this further.

This asset is included in the assets manifest file for the admin engine:
https://github.com/mainio/decidim-module-term_customizer/blob/master/app/assets/config/translation_sets_admin_manifest.js

But I'm not sure if something has changed in 0.19 regarding loading the assets. I believe they were planning some changes regarding it but we at least have few 0.19 instances where this module works normally.

Hi.

It works!

So, maybe you need to add on the documentation something like:


If you get some error, try running the following command:

RAILS_ENV=<your env> bin/rails assets:precompile

Replace with the target environment.


Thank you very much