November 17th, 2007
Good general article on rails and subversion here.
Piston Information: here.
svn:external from the red book: here.
SVN Externals -
Wanted to move the shared components to a common place. And have the following two objectives met -
- All applications that depend on the shared code can update the code.
- If update the shared code in one app, it should be saved to the central repository.
I
My preference is to use piston to manage external plugins, but to accomplish #2, I am using the svn external approach.
* Create a dummy project, create a plugin and save it to a svn repository.
- In my case because I wanted to have multiple plugins, I used the structure /plugins/trunk/test_plugin
* In a rails project that needs shared code
- make sure it is under source control
- Instead of exporting or pistoning the test_plugin use svn:externals. From /vendor/plugins execute,
$ svn propset svn:externals "test_plugin repos_path/test_plugin" . (Notice the last ‘.’)
* Update the project. From RAILS_ROOT
$ svn update vendor/plugins
You should see the plugins directory updated with a “Fetching external item into …” message
More svn:externals help –
You can edit the settings using the command -
$ svn --editor-cmd nano propedit svn:externals .
To view the external settings for the directory use,
$ svn propget svn:externals .
Posted in rails, subversion, reusable code | No Comments »
November 16th, 2007
If you are writing plugin, reusable code, or are thinking about taking DRY to the application level, the following article by Rick Olson are an absolute must read.
- Plugin Process
- Understanding Rails Initialization: Part 1
- Understanding Rails Initialization: Part 2
Tim Lucas has written a very thorough article on rails initialization that is a great read as well.
Posted in rails, plugins | No Comments »
November 15th, 2007
Ever get trapped in the svn:external mess? I did.
In a rails app, I installed a plugin using a -x option. After testing it out, it turned out that I no longer wanted it. How do I go about removing the external reference?
From RAILS_ROOT, issue this at the command line -
svn propedit svn:externals vendor/plugins
if you don’t have an editor setup, you will need to add --editor-cmd vi or whatever your editor is to the command line.
An editor pops up, listing the external dependencies. Remove the plugin you want to exclude from your app. Save and commit.
Found the answer here: RailsForum Message board
Posted in rails, subversion | No Comments »
February 8th, 2007
Deployment is an important element for any Rails application. While you iron out all the logical kinks in your application running Webrick, suprises may await you when you deploy. Have you encountered the “Application Error” screen when an application is deployed?
I decided to use my local Ubuntu box as a trial run for the complete deployment setup. That means using the exact same configuration my hosting provider uses. We are using Apache-fcgi for now and hoping to migrate soon to Apache-mongrel.
Here is a checklist of items to check as you set your environment. YMMV — and hoping that you do not run into these. The documentation on this is very sparse and for every question there will be different answers ranging from a band-aid to OS reinstall. So read through the post before you set off on the venture and make sure you have all the links handy.
Read the rest of this entry »
Posted in rails, ubuntu, apache | 3 Comments »
February 5th, 2007
It was time to upgrade to rails 1.2.1. Have been playing around it for a bit and now the hosting provider have added 1.2.1 as well. Time to tag the code and start working on the 1.2.1 branch with all the cool changes.
Here is the subversion command line to use to tag the current HEAD version
svn copy
file:///home/me/svn/myproj/trunk
file:///home/me/svn/myproj/tags/v116_final
-m "Final release in rails 1.1.6"
Note the three forward slashes are needed when referencing svn from a file structure.
Read the rest of this entry »
Posted in subversion | No Comments »
February 4th, 2007
I started off developing rails applications on a windows notebook. Life is just fine as long as you are still using scaffolding and refering to the book everytime you write code. But once you get beyond that and get serious with the design of the application, you begin to start hitting walls with windows.
I wanted to be able to test out complete installation and updates using Capistrano, test out clustering with Apache-FCGI, use process forking for some long running tasks — and the list goes on. So I set out to look at the linux alternatives. I played around with SUSE, Fedora core but I finally settled with ubuntu. Turns out ubuntu is an excellent alternative to Mac if you are on a tight budget.
I spent the next few days being a linux geek — trying all sorts of crazy things that only a lifelong windows guy would do. And in the next few post, I hope to share them with you.
Posted in rails, ubuntu | No Comments »
February 4th, 2007
If you are like me, you have a hard disk and a ram that runs your brain. When you are in a troubleshooting mode, you need quick access to relevant information — best served from the RAM. But often times, I find myself looking for bits of knowledge that used to be in the RAM a while back. This often leads to retracing the same paths — which sometimes are not very fun.
So I have decided to write down bits of information that I found useful. Tricks, tips and techniques that I learnt from the wise and experienced and used first hand to tackle a challange. Instead of putting it down in a file stashed in the confines of a notebook, I am going to post it here so that others may find it useful.
Please don’t think of this as any authoritative or comprehensive work. YMMV. Feel free to use it, add to it but be sure you know what you are doing. Like they say, “just because it is on the internet does not mean it is true”.
Enjoy — if you promise not to laugh at me.
Posted in announcements | No Comments »