views:

82

answers:

1

I'm using Capistrano and Rails 2.3.4. I've already done a deploy:cold to the remote server. Now on my local box I changed a layout file and committed it to the repository (I am using Netbeans 6 as my IDE). I type cap deploy and Capistrano runs through it's commands and tells me that it's checked out and deployed the most recent version of my code. On the server, however, the changes aren't there and when I looked at the layout file, it was using the old version not the one I just committed and supposedly deployed.

Anyone experience this?

EDIT: The weird thing is that I changed some image files and those were updated on the server, but the HTML layout I modified was not. Could it just be a cookies issue?

EDIT2: I checked the repository itself (I am using ProjectLocker) and sure enough the code is in there, modified. The issue is only that Capistrano is NOT checking it out even though it says that it is, and it's not reporting any errors.

Here is my deploy.rb file (scrubbed, of course):

# Application
set :application, "myapp"
set :deploy_to, "/var/www/html/#{application}"

# Settings
default_run_options[:pty] = true
set :use_sudo, true

# Servers
set :user, "deploy"
set :domain, "111.111.111.111"
set :runner, "deploy"
server domain, :app, :web
role :db, domain, :primary => true

# SVN
set :repository, "http://myhosting.com/svn/myapp/trunk"
set :scm_username, "[email protected]"
set :scm_password, "secret"
set :checkout, "export"

# Passenger
namespace :passenger do
  desc "Restart Application"
  task :restart do
    run "touch #{current_path}/tmp/restart.txt"
  end
end

after :deploy, "passenger:restart"

It works sometimes, it seems. For instance I made some changes to code earlier and it checked it out fine. I had an issue with it not checking out my database.yml file either; I was forced to edit it on the server.

+2  A: 

Just a shot in the dark here, but did you actually look at the layout file or did you hit the website and then look at the webpage source?

If you are in production the layout will be cached (config.action_controller.perform_caching = true), you need to reboot the server. This does not occur in development mode by default, since the above setting is set to false.

See this for more info.

JRL
I loaded the layout file with vi on the server itself, and the changes weren't there. So whenever I change a file I need to reboot Apache? Hmm.. that's not going to be good since we have other PHP-based systems on that same server that are being served in addition to the RoR app, and rebooting Apache will force them to go down for a few seconds. Not good if we have people using it at the same time that I have to restart Apache.
Wayne M
Well, I spoke too soon. It seems to be caching because I loaded the page now and the changes are there. Strange that the file itself didn't show the changes though. Still, that may cause us issues if I have to restart the whole server and risk outages in the other applications.
Wayne M
You can restart your app without restarting Apache by creating a file named tmp/restart.txt:$ touch tmp/restart
JRL
When checking for changes in the file, did you already have the file open? The file in `releases/old-timestamp/` won't actually change. There'll be a new file in `releases/new-timestamp/` and the `current` symlink will be updated to point at `releases/new-timestamp`.
Emily