Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8008057
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T18:01:21+00:00 2026-06-04T18:01:21+00:00

Where would I put the precompile info in my deploy.rb file. What do I

  • 0

Where would I put the precompile info in my deploy.rb file. What do I need to change to get this working? I am able to get my app to run using

RAILS_ENV=production rake assets:precompile

Precompile info

after "deploy:restart", "deploy:precompile"

    namespace :deploy do

      desc "Compile assets"
      task :precompile, :roles => :app do
        run "cd #{release_path} && rake RAILS_ENV=#{rails_env} assets:precompile"
      end

     end

My deploy.rb

    # The name of your app
set :application, "sample_app"

# The directory on the EC2 node that will be deployed to
set :deploy_to, "/var/www/#{application}"

set :keep_releases, 3

# deploy with git
set :scm, :git
set :repository,  "git@github.com:username/sample_app.git"
set :git_shallow_clone, 1
set :branch, "master"
set :use_sudo, true

# gets ssh info
set :user, "ubuntu"
ssh_options[:keys] = ["/Users/User/Documents/ServerKeys/key.pem"]
ssh_options[:forward_agent] = true
default_run_options[:pty] = true

# The address of the remote host on EC2 (the Public DNS address)
set :location, "0.0.0.0"

# setup some Capistrano roles
role :app, location
role :web, location
role :db,  location, :primary => true

after 'deploy:update_code', 'deploy:symlink_db'

namespace :deploy do

desc "Restart Application"
task :restart, :roles => :app do
  run "touch #{deploy_to}/#{shared_dir}/tmp/restart.txt"
end

desc "Symlinks the database.yml"
task :symlink_db, :roles => :app do
  run "ln -nfs #{deploy_to}/shared/config/database.yml
  #{release_path}/config/database.yml"
end

end
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-04T18:01:24+00:00Added an answer on June 4, 2026 at 6:01 pm

    Capistrano (v2.8.0 and above) includes a recipe to handle this in deployment. Add the following line to Capfile:

    load 'deploy/assets'
    

    http://guides.rubyonrails.org/asset_pipeline.html#precompiling-assets

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am busy working on this and thought I would put it our there.
I would put in this code a control on EditText so that it only
Normally in a web app i would put a font-family in the CSS something
Ok so I thought i would put this one out there. I have a
Using 'old school' javascript you would put the ID as the parameter in an
Ok, this is possibly borderline-subjective, but I wonder where one would put a simple
I would like Visual Studio to automatically put my .h file in a folder
I need to know how one would put the following JSON into elements with
App reads JSON data. Then it would put it to whe listview (correctly) but
I'm kind of confused. I would put all the HTML for the menu in

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.