Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Missing Template error in production #61

Closed
pulkit21 opened this issue Sep 8, 2016 · 10 comments
Closed

Missing Template error in production #61

pulkit21 opened this issue Sep 8, 2016 · 10 comments

Comments

@pulkit21
Copy link

pulkit21 commented Sep 8, 2016

I, [2016-09-08T17:25:44.073936 #41694]  INFO -- : Started GET "/admin/tablets_list" for 127.0.0.1 at 2016-09-08 17:25:44 +0530
I, [2016-09-08T17:25:44.107349 #41694]  INFO -- : Processing by Admin::CabinetsController#tablets_list as HTML
I, [2016-09-08T17:25:44.199807 #41694]  INFO -- :   Rendered admin/cabinets/tablets_list.html.erb within layouts/admin/application (63.1ms)
I, [2016-09-08T17:25:44.202837 #41694]  INFO -- :   Rendered shared/_flash_notifier.html.erb (0.6ms)
I, [2016-09-08T17:25:44.203983 #41694]  INFO -- : Completed 200 OK in 97ms (Views: 64.0ms | ActiveRecord: 10.0ms)
I, [2016-09-08T17:25:47.090020 #41694]  INFO -- : Started GET "/download_excel.xlsx" for 127.0.0.1 at 2016-09-08 17:25:47 +0530
I, [2016-09-08T17:25:47.091346 #41694]  INFO -- : Processing by Admin::CabinetsController#download_excel as XLSX
I, [2016-09-08T17:25:47.099323 #41694]  INFO -- : Completed 500 Internal Server Error in 8ms (ActiveRecord: 0.2ms)
F, [2016-09-08T17:25:47.100854 #41694] FATAL -- :
ActionView::MissingTemplate (Missing template admin/cabinets/download_excel, admin/base/download_excel, application/download_excel with {:locale=>[:en], :formats=>[:xlsx], :variants=>[], :handlers=>[:erb, :builder, :raw, :ruby, :coffee, :jbuilder]}. Searched in:
  * "/Users/pulkit/dev/dev-scotta-smartcabinets/app/views"
  * "/Users/pulkit/.rvm/gems/ruby-2.2.1/gems/devise-3.4.1/app/views"
):
  app/controllers/admin/cabinets_controller.rb:12:in `block (2 levels) in download_excel'
  app/controllers/admin/cabinets_controller.rb:11:in `download_excel'


Controller action

def download_excel
  @cabinets = Cabinet.all
  respond_to do |format|
    format.xlsx {render xlsx: 'download_excel',filename: "smart_cab.xlsx"}
  end
end

In development its working fine without any error but in production it's giving me the Template missing error, please help.

@pulkit21 pulkit21 changed the title Missing Template error Missing Template error in production Sep 8, 2016
@straydogstudio
Copy link
Collaborator

@pulkit21 If you could set up a repo with the applicable parts, that would be great. It may be an interaction with another gem. Are you using an admin gem? If you can't do a repo, please create a gist with more code (including the Gemfile) so I can reproduce this. I can see what the problem is, I need to recreate it.

@straydogstudio
Copy link
Collaborator

What versions of Rails, Axlsx, axlsx_rails, and rubyzip are you using?

@pulkit21
Copy link
Author

pulkit21 commented Sep 8, 2016

@straydogstudio
Rails- 4.2.1
Axlsx- 2.0.1
axlsx_rails- 0.1.5
rubyzip- 1.0.0

@pulkit21
Copy link
Author

pulkit21 commented Sep 8, 2016

@straydogstudio
Copy link
Collaborator

I don't think it will help, but have you tried Axlsx '2.1.0.pre' and rubyzip 1.1.0?

@straydogstudio
Copy link
Collaborator

@pulkit21 I think I have it. You've got axlsx and axlsx_rails inside development/test in your Gemfile. Move that outside and I expect it would work.

If you look in your error, there is no axlsx handler listed. That would fit.

@pulkit21
Copy link
Author

pulkit21 commented Sep 9, 2016

Silly me I didn't notice that the gems are under development/test. Thanks a lot @straydogstudio for pointing out my mistake.

@pulkit21 pulkit21 closed this as completed Sep 9, 2016
@straydogstudio
Copy link
Collaborator

You're welcome.

@nitin-cis
Copy link

I am having the same issue of missing template in production environment and my gem are also out of development/test environment in Gemfile

gem 'rubyzip', '>= 1.2.1'
gem 'axlsx', git: 'https://github.com/randym/axlsx.git', ref: 'c8ac844'
gem 'axlsx_rails'

can anyone help me on this.

@straydogstudio
Copy link
Collaborator

@nitin-cis Do you have axlsx_rails 0.5.2 in your Gemfile.lock? I would add your comment to issue 100. So far I haven't been able to reproduce the error, but I will keep trying. If you are willing to post your Gemfile.lock to a gist for me to look at that might help.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants