設定追加
./config.ru
# This file is used by Rack-based servers to start the application. require ::File.expand_path('../config/environment', __FILE__) map ENV['RAILS_RELATIVE_URL_ROOT'] do run MyAppName::Application end
公開用のディレクトリを新規作成
$ mkdir web $ cd web $ ln -s ../public [サブディレクトリとして使う名前]
unicorn 起動
bundle exec unicorn_rails -c ./config/unicorn.rb --path /[サブディレクトリとして使う名前] -E development -D
プリコンパイル
AILS_RELATIVE_URL_ROOT=/dashboard RAILS_ENV=production bundle exec rake assets:precompile --trace
carrywave でpublic に保存するように設定している場合も、問題なく機能します。
他の方法もいろいろネットには書かれていますが、
これ以外だとどこかしらで問題が出ます。