Start A New Merb (Stack) Project

This is what I do to start a brand new Merb project utilising the Merb Stack. (complete for thoroughness, I don’t actually install ruby every time)

First up is a summary and then the next part will go into each step in detail.

  1. Install ruby
  2. Install ruby gems
  3. Install thor gem
  4. Create project dir
  5. Go into project dir
  6. Get the merb.thor task file
  7. Create gems dir
  8. Install merb (stack)
  9. Install merb-gen
  10. Run merb-gen to generator new app in current dir
  11. Update dependencies
  12. Remove merb.thor task file
  13. Run bundler to update all gems
  14. Configure database.yml
  15. See if it works
  16. Initialise project as a git repository
  17. Make 1st commit
  18. Get on with the project

(the headings are stacked tight because the detail below is related to all those steps.)

1. Install Ruby

2. Install Ruby Gems

3. Install Thor

I have ruby setup per user and don’t use a system install of ruby, this make things very simple for me.
I setup a directory “_source” with the ruby, rubygems and a simple install_ruby script. Run the script and ruby, rubygems and thor are installed.

4. Create project dir

5. Go into project dir

6. Get the merb.thor task file

7. Create gems dir

8. Install merb (stack)

The reason why I create the gems dir in the project dir is so that thor installs the gems in the project dir.

9. Install merb-gen

10. Run merb-gen to generator new app in current dir

I like HAML so I specify the option to use HAML straight away

11. Update dependencies

I’ve added in extras like haml, mongrel, etc – you needs these if you want it to “just work”.

12. Remove merb.thor task file

13. Run bundler to update all gems

14. Configure database.yml

Since I’m using MySQL, update everything in there…

15. See if it works

Everything is ready to go now.

16. Initialise project as a git repository

17. Make 1st commit

18. Get on with the project