ファイルのリストがあり、相対パスを取得しようとしています
file = "/Users/yves/github/local/workshop/public/uploads/craftwork/image/1/a1d0.jpg"
Rails.public_path => "/Users/yves/github/local/workshop/public"
#取得しようとしています=> "uploads / Craftwork / image / 1 / a1d0.jpg"
file.relative_path_from(Rails.public_path) # is wrong
# raising : undefined method `relative_path_from' for #<String ( file is a String..)
# so I tried to use Pathname class
Pathname.new(file).relative_path_from(Rails.public_path)
# but the I get another error
# undefined method `cleanpath' for String
Rails 3.2ではrelative_path_fromは非推奨ですか?はいの場合、今の良いものは何ですか?