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.
- Install ruby
- Install ruby gems
- Install thor gem
- Create project dir
- Go into project dir
- Get the merb.thor task file
- Create gems dir
- Install merb (stack)
- Install merb-gen
- Run merb-gen to generator new app in current dir
- Update dependencies
- Remove merb.thor task file
- Run bundler to update all gems
- Configure database.yml
- See if it works
- Initialise project as a git repository
- Make 1st commit
- 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.