1
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

【Rails】carrierwaveの使用時「Nil location provided. Can't build URI.」が出てきた時の解決方法

Posted at

エラー発生

carrierwaveで実装中、画像を投稿しようとしても

Nil location provided. Can't build URI

のエラーが出てきた。

解決方法

uploaderでデフォルトの設定を忘れてた。

  def default_url
    'board_placeholder.png'
  end

こうやって設定すると画像がない場合もデフォルトを出してくれるのでエラーが出なくなった。

1
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?