You probably need to File.expand_path(‘public’ + ‘/images/img2.jpg’,
RAILS_ROOT)
to get a real file name on your system. I presume that the ‘/images/
img2.jpg’ will be replaced with some variable that is meant to be an
absolute “web” path, but you need a “file system” path.