deploying change made to a .haml file

hello all.

am new to RoR so am not sure of the conventions of how to ask a question so forgive me.

we had a site built using rails 3 http://www.threadme.co.uk/

we have been trying to learn rails to take over management of the site ourselves.

we've recently got to the stage where we have a copy of the site on our local machine.

we'd like to change the text on the front page of the site "threadme is a clothing co-operative supplying you with fairtrade certified clothing, and a little more besides..."

as far as we can tell this text originates from threadme/app/views/static/home.haml

we have made the text changes that we want using vim but these have not come up on the home page on localhost:3000

what do we have to do to make these changes register?

we're running debian lenny.

please let me know if you need any more info.

hello all.

am new to RoR so am not sure of the conventions of how to ask a question so forgive me.

we had a site built using rails 3 http://www.threadme.co.uk/

we have been trying to learn rails to take over management of the site ourselves.

we've recently got to the stage where we have a copy of the site on our local machine.

we'd like to change the text on the front page of the site "threadme is a clothing co-operative supplying you with fairtrade certified clothing, and a little more besides..."

as far as we can tell this text originates from threadme/app/views/static/home.haml

we have made the text changes that we want using vim but these have not come up on the home page on localhost:3000

what do we have to do to make these changes register?

If the app is in production mode you'll need to restart it (exactly depends on how the app was deployed. If it's using passenger then touching app_root/tmp/restart.txt should do the trick)

Fred

Frederick Cheung wrote in post #988195:

It is very important that you locate the deploy.rb file it should be in the config directory, is not directly related to your question but it is important that you know how the app was deployed

Hi Fred,

do you have any advice for what to do if the site is in development mode and not production mode?

We have touch app_root/tmp/restart.txt and changes have not implemented

s

sal streets wrote in post #988200:

Radhames Brito wrote in post #988201:

It is very important that you locate the deploy.rb file it should be in the config directory, is not directly related to your question but it is important that you know how the app was deployed

Hi Radhmes,

there is no deploy.rd in config but we do have this info from the initial developers

"ull Ruby on Rails stack such as Phusion Passenger + Apache (with Ruby 1.8.6).

In addition, you will need a MySQL server.

The current site is held in Version Control software called Git. We deploy it using Capistrano. "

Hi Fred,

do you have any advice for what to do if the site is in development mode and not production mode?

well if it was in development mode the app should reload itself on each request

We have touch app_root/tmp/restart.txt and changes have not implemented

Just to make sure we're talking about the same thing, you touched tmp/ restart.txt where the app is deployed (not the systemwide /tmp). (this is often somewhere like /var/www/app_name). And just to eliminate, the unlikely, you are doing this on the correct server?

You could also just restart apache on your servers, although that shouldn't be necessary.

If there is a capistrano recipe for the app then you should be able to redeploy it via cap deploy:migrations (assuming a standard capfile)

Fred

I see, if with was deployed with capistrano there is a deploy.rb somewhere this file is a script (also called a recipe) with lots of valuable information. I will now explain what capistrano does and why you need to undertand how your app was deployed.

Capistrano read the deploy.rb file and finds out the name of the web server, the repository server and the db server. all this info must be put in the deploy.rb file by the developer. Then you specify your versioning system, in your irb file there must be something like this

set :deploy_via, :remote_cache

set :scm, ‘git’

set :branch, ‘master’

set :scm_verbose, true

set :use_sudo, false

what capistrano does the first time you deploy your app is, it creates a folder structure where it puts a release directory, in it is at least the last 5 versions of the app, next to it is a current directory, this current directory is a symbolink link to the latest realease in the releases directory. You , the developer make Passenger point to the public directory of the current directory, that is , in your httpd file

there should be a host to app_path/current/public. It also creates a shared folder where data that is common between releases i stored.

That is what happens the first time you are going to deploy with the command

cap deploy:setup

after that for each deployment it does this :

1 Checkouts the head of the master branch from the specified repository server via the specified version management system

2 Rebuild the symbolic link of the current directory so that it now point to the latest release in the releases directory.

3 Touches the file current/tmp/restart.txt , which causes passenger to restart

As you can see is posible that you are editing

  1. the app that is sometime directly in the deploy_to path and not the one inside the current directory

  2. One of the releases that is not the current

  3. the wrong restart.txt

The best way to update your app is via capistrano, this are the steps

if you dont have access to the source code, if you do you can go to 3

  1. Find out where is the repository

  2. do git clone path_to_repository

  3. check for the database.yml file since it is posible that it was not version managent and is missing

  4. if is not there make one and add the proper servers

  5. bundle install <====== to install the gems

  6. git checkout -b updating_static <========to create a branch and not mess up the original code

  7. edit at will

  8. git checkout master

  9. git merge updating_static <======== to apply your changes to the master

10 ) git push origin master <==== this should send the changes to the repository

Here is where you start to use capistrano

  1. cap deploy <=== it may ask for password serveral times , each time it connect to one of the servers

you are done.

As you can see with capistrano everything takes one command, cap deploy, everything above was so you can have a copy of the app in your development machine.

Capistranos has everything it need in the deploy.rb file is in the repository pull it and checkit out, if you want to you can put it here ( remove any passwords and ip) and we can tell you what is suppose to do.

sorry there are many typos, this one is important

  1. the app that is somewhere directly in the deploy_to path and not the one inside the current directory

is somewhere not sometime, sorry

hi guys,

thanks for your help.

i have figured out that the front page of www.threadme.co.uk is actually a jpg. so the changes that i had made did register instantly, it's just that the jpg was unaffected (i guess this will be in the style sheets somewhere).

i will look into all your advice and try to absrob it into my head.

cheers

nice to know you solved the issue, but dont forget to read about capistrano it will make everything easier for the future.