0
0

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.

Herokuデプロイ時に「 `relative_path_from': different prefix」がでたよ

Posted at

heroku本番環境にS3を使いたかったので、gem aws-sdkを登録し、
bundle installおよびcommit、リモートリポジトリにpushまでしたあと

$ git push heroku dev:master

を実行したら

Enumerating objects: 7, done.
Counting objects: 100% (7/7), done.
Delta compression using up to 8 threads.
Compressing objects: 100% (4/4), done.
Writing objects: 100% (4/4), 5.73 KiB | 2.87 MiB/s, done.
Total 4 (delta 2), reused 0 (delta 0)
remote: Compressing source files... done.
remote: Building source:
remote: 
remote: -----> Ruby app detected
remote: 
remote:  !
remote:  !     different prefix: "" and "/tmp/build_edc3150bda146e5ca10eb1b67d801667"
remote:  !
remote: /app/tmp/buildpacks/b7af5642714be4eddaa5f35e2b4c36176b839b4abcd9bfe57ee71c358d71152b4fd2cf925c5b6e6816adee359c4f0f966b663a7f8649b0729509d510091abc07/vendor/ruby/heroku-18/lib/ruby/2.5.0/pathname.rb:522:in `relative_path_from': different prefix: "" and "/tmp/build_edc3150bda146e5ca10eb1b67d801667" (ArgumentError)

というエラーがでた。

解決策

rails sをすると、

$ rails s
Your lockfile is unreadable.
Run `rm Gemfile.lock` and then `bundle install` to generate a new lockfile.

とでたので、rm Gemfile.lockを実行し、bundle installを実行。

その後、再度git push heroku dev:masterをすると、deploy成功。


ググってもまったくヒットしなかったので、
この記事にヒットした方は試してみてください。。


おわり

0
0
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
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?