senny / pdfjs_viewer-rails

PDF.js viewer packaged as a Rails engine.
MIT License
114 stars 174 forks source link

uninitialized constant PdfjsViewer (NameError) #21

Closed roomaroom closed 2 years ago

roomaroom commented 8 years ago

In production mode I got this error config/routes.rb:17:in block in <top (required)> : uninitialized constant PdfjsViewer (NameError) My routes.rb mount PdfjsViewer::Rails::Engine => "/pdfjs", as: 'pdfjs' In development mode everything is ok

siegy22 commented 8 years ago

Can you load any other dependency?

(For example open up a rails console on your production environment and use a module or class that should have been defined by a dependency)

buncis commented 7 years ago

I have this issue before, what I'm doing to fix this is, remove mount PdfjsViewer::Rails::Engine => "/pdfjs", as: 'pdfjs'from routes.rb and gem 'pdfjs_viewer-rails' from Gemfile then bundle after that I put the gem 'pdfjs_viewer-rails' to the Gemfile and bundle install then make sure the pdfjs_viewer-rails is loaded then I put this mount PdfjsViewer::Rails::Engine => "/pdfjs", as: 'pdfjs' to my routes.rb now its work

siegy22 commented 7 years ago

@roomaroom are you using Spring? Maybe spring cached a corrupt state. 😐

evolve2k commented 2 years ago

I've just run the project now on Rails 7 and it's working as expected. This issue is 5 years old, Im guessing it is no longer relevant.

Recommend close.

senny commented 2 years ago

@evolve2k Thanks for your feedback. I'm closing the issue. If the problem comes up again, we can reopen.