Question

I want to decode QR codes in my rails app. I am using Qrio gem which needs ChunkyPng gem to work. It is working fine when i write and run a ruby program using it. But, when i try using it with Rails it does not work.

This isthe error i get.

No such file or directory - chart.png

Extracted source (around line #5): 3 4 5 6 7 8

class PNGImageLoader
  def self.load(filename)
    image = ChunkyPNG::Image.from_file(filename)

    bits = image.pixels.map do |pixel|
      grayscale = ChunkyPNG::Color.to_grayscale(pixel)
Was it helpful?

Solution

It appears that the file you're trying to load doesn't exist. It seems to be looking for chart.png in your root directory. Make sure you use a full path and it will probably work.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top