senny / pdfjs_viewer-rails

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

Syntax Error in Helper #7

Closed Patrax closed 8 years ago

Patrax commented 8 years ago

When deploying to Heroku, this error comes up.

Important part:

def pdfjs_viewer(style:, pdf_url: nil, title: nil)

Full error:

/app/vendor/bundle/ruby/2.0.0/gems/activesupport-4.2.1/lib/active_support/dependencies.rb:274:in `require': /app/vendor/bundle/ruby/2.0.0/gems/pdfjs_viewer-rails-0.0.6/lib/pdfjs_viewer-rails/helpers.rb:4: syntax error, unexpected ',' (SyntaxError)
2015-11-17T19:29:45.025205+00:00 app[web.1]:       def pdfjs_viewer(style:, pdf_url: nil, title: nil)
rambino commented 8 years ago

remove the : at the end of style.

def pdfjs_viewer(style, pdf_url: nil, title: nil)
rchampeimont commented 8 years ago

I had the same problem. The issue is that in my case I cannot easily modify the file provided by the gem since I have an automatic deployment in AWS: machine starts, git pull, bundle install, then rails runner something and it crashes because of this bug.

I fixed the problem by bundle installing all packages in vendor/bundle and then making the fix, but it forces to have all packages uploaded in my repo so that's not entirely optimal.

senny commented 8 years ago

@Patrax this library requires at least Ruby 2.1