LoginSignup
0
0

More than 5 years have passed since last update.

サブディレクトリ付きのURLでassets配下を正しく参照できるようにする

Posted at

メモがてら
同一ホストで複数のアプリを起動する場合、サブディレクトリを使用することがあると思います。その場合、サブディレクトリ付きのURLでアクセスするとルート直下のassetsをアプリが参照してしまいます。回避手段としてはprecompileすに下記のようにRAILS_RELATIVE_URL_ROOTにサブディレクトリを指定することでできるようです。

bundle exec rake assets:precompile RAILS_ENV="${RAILS_ENV}"  RAILS_RELATIVE_URL_ROOT=/subdir
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