I am building a gem (see here for full source code) and I am having issues exporting assets to Rails.
The tests I wrote in the gem work well, but when I install the gem on Rails some of the assets are missing, for example the images are not found, I got the following error on Rails:
# error I got when installed on Rails
unable to open image `app/assets/images/swiss_cross.png': No such file or directory @ error/blob.c/OpenBlob/2701
The Gem code raising the error is this one:
# Gem source code
# lib/qr-bills/qr-generator.rb
[...]
swiss_cross = Image.read("app/assets/images/swiss_cross.png")[0]
[...]
Any ideas what I am missing?
Simply use full paths to your assets like it has been done here and don't depend on the files being present on your current directory. In your case Rails' already has app/*
.