samedi 10 mars 2018

rqrcode on ruby rails

I tried the example in this website:

https://richonrails.com/articles/generating-qr-codes-in-your-ruby-on-rails-application

to generate a qr code. there seems to be a problem with the 'require rqr-code' line which I have in the config/environment.rb file.

I checked that the gem is installed and it is. I removed the line 'require rqr-code' from the config/environment.rb file and then I get error 'uninitialized constant QrCodesController::RQRCode' at the controller:

 def create
    @qr = RQRCode::QRCode.new(qr_code_params[:text],size:4)
 end

when I re-add the line 'require rqr-code' and restart the rails server, I get the error - 'require': cannot load such file - rqrcode (LoadError).

I have been at this for some hours trying to figure out what it is. Thanks.

Aucun commentaire:

Enregistrer un commentaire