OmniNerd Article Propagation

Most Nerd-Its | Nerd Trends | Last Ten

  1. RE: Dang snap in markmcb's Top 5 iPhone App Picks for 2009
  2. Going off topics to space....the toilet frontier in Mainstreaming 9/11 Conspiracy Theories
  3. RE: Yeah, reputation for not being able to explain grade school physics. in Mainstreaming 9/11 Conspiracy Theories
  4. Check out the Lindberg Videos in Lindberf flying NY to Paris
  5. RE: Yeah, reputation for not being able to explain grade school physics. in Mainstreaming 9/11 Conspiracy Theories
  6. RE: Yeah, reputation for not being able to explain grade school physics. in Mainstreaming 9/11 Conspiracy Theories
  7. RE: Yeah, reputation for not being able to explain grade school physics. in Mainstreaming 9/11 Conspiracy Theories
  8. RE: Yeah, reputation for not being able to explain grade school physics. in Mainstreaming 9/11 Conspiracy Theories
  9. RE: Yeah, reputation for not being able to explain grade school physics. in Mainstreaming 9/11 Conspiracy Theories
  10. Yeah, reputation for not being able to explain grade school physics. in Mainstreaming 9/11 Conspiracy Theories

What is OmniNerd?

Welcome! OmniNerd's content is generated by you, the reader. Through voting and moderation we strive to highlight the nerdiest of what's around and provide content that's a little more thought provoking than other sites.

Voting Booth

Favorite Emoticon?

34 votes, 7 comments
3 Nerd-Its - +

Preserve Rails Ferret Index with a Symlink and Capistrano

Cup an opinion article by Mark A. McBride (markmcb), published on 29 September 2007
tagged as ferret, index, capistrano, and rubyonrails

If you’re deploying your Rails application with capistrano and using ferret as your app’s index, you’ll quickly notice that with every deployment/update to your production code will come a ferret index rebuild. Not good.

Luckily, the solution is quite simple.

First, deploy your app and build your index. Once that’s done, copy your index folder to the shared folder:


cp -R /path/to/your/app/current/index /path/to/your/app/shared/

Lastly, in your deploy.rb file that you use to control your deployments, tell capistrano to create a symlink to the shared directory for your ferret index:


desc "Preserve ferret index" 
task :after_update_code, :roles => [:web] do
  run <<-EOF
    ln -s #{shared_path}/index #{latest_release}/index
  EOF
end

That’s it. Now every time you deploy, your index is the same as it was before. This is great 99% of the time, but don’t forget to rebuild your index manually if you modify your indexed data structures.

Similarly tagged OmniNerd content: