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 7446869
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 29, 20262026-05-29T12:27:11+00:00 2026-05-29T12:27:11+00:00

I am developing 2 applications in Rails 3.1 (will upgrade soon), and have noticed

  • 0

I am developing 2 applications in Rails 3.1 (will upgrade soon), and have noticed that my current strategy has its drawbacks. What I am doing currently is:

  • Work directly on the development directory, have there version control with Git (which works perfect for me).
  • I have defined the databases like (omitted not interesting parts):

    development:
      database: db/dev.db
    production:
      database: db/dev.db
    
  • I have both applications running all the time in production mode, where the ports are defined as 3008 and 3009.

  • From time to time, I want to change little things, and start then a development server for one of the two applications directly with the defaults: rails s thin (port == 3000).

I have noticed that the following things don’t work very well.

  • When I change CSS or Javascript files, I have often to cleanup (and after development rebuild) the assets.
  • Sometimes, the development server takes the files (CSS and Javascript) from one server and uses them for the other server. I have to manually clean the caches for the browser to avoid that.

What would be a better strategy to develop and use the two applications in parallel locally on my computer? Any tips and hints are welcome. Should I use a deployment tool (Capistrano) for that? Shall I roll my own Rake task for the divide? Or do I miss some magic switch that will heal the wounds (sounds pathetic :-))?

  • 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-05-29T12:27:12+00:00Added an answer on May 29, 2026 at 12:27 pm

    At the end, it is a mix of changes, so I answer my own questions and hope that others may learn something from it. At the end, there are 2 major decisions (and some minor ones):

    • Work with different repositories for development and production, even on the same machine. Add another one (a bare one) to synchronize the two. Push only from the development, pull only from production.
    • Use different ports all the time for different applications. Make a scheme like:
      • appA: dev ==> 4001, prod ==> 3001
      • appB: dev ==> 4002, prod ==> 3002
      • …

    Here are the changes that I have done. rails/root is the root directory of my application, the overall directory structure is the following:

    rails/
      root/
      another/
      ...
      bare/
        root.git/
        another.git/
        ...
      production/
        root/
        another/
        ...
    
    • Create 2 new repositories from the old one, one as a bare repository, the other one for production only:
      1. mkdir rails/production
      2. mkdir rails/bare
      3. cd rails/bare
      4. git clone ../root --bare
      5. cd ../root
      6. git remote add bare ../bare/root
      7. cd rails/production
      8. git clone ../bare/root
      9. cd root
      10. git remote add bare ../../bare/root
    • Don’t use one (the same) database for development and production, just to be sure that Git can do its magic.
    • Develop (only) on the development repository.
    • After enough tests, do the following 2 steps:
      1. root> git push bare
      2. root/../production/root> git pull bare
    • Start the development server (only) with: root> rails s thin -p 4009
    • and the production server (only) with: root/../production/root> rails s thin -e production -p 3009

    So as a result, I have a little more work to do, to stage changes from development to production, but I will eliminate those small irritations that were around all the time.

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

Sidebar

Related Questions

I am developing a Rails application that will access a lot of RSS feeds
I am developing a rails application that will eventually contain products, users, and orders.
I've been developing Ruby on Rails applications for some time, and have often found
We are developing an application that has an iPhone client, and a Rails server.
I am currently developing a Rails application using a database that was designed before
I'm developing a Ruby on Rails application that needs to allow the user to
I am developing a Rails 1.0 application (I can't upgrade, it's a strange situation)
I am developing a Rails application which will need frequent access to public APIs,
So, I'm developing my rails applications on my mac, thro WEBrick at 0.0.0.0:3000 and
I'm developing an application with Ruby on Rails that I want to maintain for

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.