Creating a 2nd application

Subscribe to Creating a 2nd application 4 post(s), 3 voice(s)

 
Avatar michael 4 post(s)

Hi all

Just looking for some advice … I have an app up on bright box but want to add a second one. I’ve created the second app on my laptop – is there anything I need to configure for a second app? Concerned that if I run a ‘deploy’ it will over-write my existing one!

Cheers

Mike

 
Avatar youresolutions 12 post(s)

Hi Mike,

In the config/deploy.rb of your new application, on about line 8 set the name of your application to be unique (this also determines the directory it’ll be uploaded to) and it’ll run alongside the other one on the same Brightbox. Also set the domain name, etc, while you’re there.

Cheers,
Ian

 
Avatar michael 4 post(s)

Hi Ian

Thanks for the advice :-)

I think I’m almost there … except when I try to run “cap deploy:web:reload” I get the error “Invalid command ‘RailsEnv’, perhaps misspelled or defined by a module not included in the server configuration”. My BrightBox is pretty old but I suspect ‘RailsEnv’ just isn’t installed but I don’t know how to install it.

I tried removing ‘RailsEnv production’ from /etc/apache2/sites-available/rails-myapp and this removes the error. When I do this, the web server starts and I can see the “You’re riding rails” HTML page but as soon as I append a controller name to the URL I get a 404 error … assuming this is because Apache isn’t passing the request on to an application server?

Do you think I need to install whatever ‘RailsEnv’ is? Any idea how?

Cheers!

Mike

 
Avatar Rahoul Baruah Administator 31 post(s)

RailsEnv is a Passenger directive that tells Passenger which environment to start your application in. It is detailed here: http://www.modrails.com/documentation/Users%20g…

The default should be production, so you don’t really need it in there (assuming you want your application to run in the production environment). But, if you’re getting errors you then need to check your application’s logfile – /home/rails/my-app/current/log/production.log to see what is causing the 404.

Rahoul.

Signup or login to contribute