-
Notifications
You must be signed in to change notification settings - Fork 376
Serving Assets in Production
Before pushing your application to production, you'll need to determine how you want your assets served. You can either compile them on-the-fly or precompile them (recommended). Before continuing you'll want to check your Rails' application Gemfile and make sure that gem "zurb-foundation"
is included under the assets
group.
In your Rails application edit config/application.rb
and change:
Bundler.require(*Rails.groups(:assets => %w(development test)))
to:
Bundler.require(:default, :assets, Rails.env)
Then in config/environments/production.rb
make sure the following setting exists:
config.assets.compile = true
Now all your assets will be compiled the first time someone visits your site, which can cause some delay. Kind of like the first time Passenger spins up your application after it has been idle for some time.
In your Rails application edit Capfile
and add the following line after load 'deploy'
:
load 'deploy/assets'
Now when you run cap deploy
the deploy:assets:precompile
task will be run which automatically takes care of running bundle exec rake assets:precompile
for you.
By default assets that are precompiled will be located in the public/assets/
folder of your application.