To build FubuMVC you need to install ruby, rake etc. Unfortunately for me the firewall at work will not allow me to get the rake gem (I’ve downloaded gems before using the HTTP_PROXY setting before but no luck this time). Any hoose I remember reading Stephen Balkum post on packaging up Rake as an executable. I followed Stephens guide and created a portable rake package which got around my firewall problem but FubuMVC required another gem rubyzip to allow a build.
Adding another gem
Luckily using Stephen’s guide its really easy to add extra gems, you just need to have them installed before you build your exe. So we follow the first part of the process outlined in Stephen’s guide then do the following:
NOTE: In this case we need rubyzip but it could be any old gem.
- Download rubyzip and extract to contents to c:\rubywork\zip
- To install rubyzip, at a command prompt in c:\rubywork\zip, run ..\ruby\bin\ruby install.rb
- Download zlib and extract the zlib1.dll to C:\rubywork\ruby\lib\ruby\1.8\i386-mswin32
- Rename zlib1.dll to zlib.dll (rubyzip required this extra dll other gems may not)
Now continue part two of the process from Stephen’s guide to compile your very own allinoneruby.exe which includes, rake and rubyzip.
You should now have allinoneruby.exe and rake.rb file.
We can now drop these files into to the FubuMVC project under the build support folder:
We need a helper batch file in the root folder of FubuMVC called rake.bat which contains:
@.\build_support\allinoneruby.exe .\build_support\rake.rb %*
This will be called when we run the build.
Run the build already
Drop to the command prompt and cd into the FubuMVC project root and simply type build. You should get something like:
Don’t want to go through all that? You can download my version of portable rake here (I don’t think I’m breaking any licensing agreements here, this is all open source software. If I am let me know and I’ll remove the link)
DISCLAIMER: I offer no guarantees I can only confirm this works on my machine!
One final note
I’ve used this method to build some of the other open source projects out there which use rake (all the cool kids seem to be using rake) and so far I’ve not had any problems. This could be pretty frictionless way to introduce rake to a team of .net developers who don’t want the overhead of installing ruby on their machines. Just add it to a tools folder check it in to source control they’ll never know!
UPDATE: Lots of changes are a foot with FubuMVC so a few new blog posts appearing, I’ll update this post as I find them.
I’m looking at FubuMVC for a side project, I thought it would be useful to collect a list of resources.
- FubuMVC Subversion Git – Framework source code
- FubuMVC Contrib – Sample projects and add on’s to the main framework
- Setting up a FubuMVC Project from Scratch – Four part series by Ryan Kelley (Part 2, Part 3, Part 4) the source code for this series is part of the FubuMVC Contrib project although I would recommend you follow along with the series and type the code as you go
- Simple application using FubuMVC – Introduction by Shashank
- FubuMVC AltOxite Works! – Guide to getting AltOxite to work (AltOxite source code is part of the FubuMVC Contrib project)
- FubuMVC – Front Controller style framework - Overview of the framework by Mark Nijhof. Note Mark’s blog was written in FubuMVC and the source is part of the FubuMVC Contrib project
- Mark Nijhof – writes up the main points from his European Virtual Alt.Net presentation
- FubuMVC.Validation – Convention based validation – Mark Nijhof describes his validation add on for FubuMVC. His validation add on is part of the FubuMVC Contrib project
- Switch between View Result and Json Result without sweat in FubuMVC
- Our “Opinions” on the ASP.NET MVC (Introducing the Thunderdome Principle) – FubuMVC evolved from a set of opinions over Asp.Net MVC. Jeremy details the “Thunderdome” principal – “All Controller methods take in one ViewModel object and return one ViewModel object”. I guess the Thunderdome name comes from the similarity to the rules of Thunderdome – “Two men enter, one man leaves.”
- Going Controller-less in MVC: The Way Fowler Meant It To Be – Chad Myers describes where FubuMVC is going
- What’s happening with FubuMVC and Where’s Ryan been? Ryan Kelley talks about recent changes to FubuMVC
- FubuMVC Video from Houston ALT.NET
- Mark Nijhof presents FubuMVC at the European Virtual Alt.Net
- Two part video (Part 1, Part 2) of Jeremy Miller and Chad Myers give their opinions on Asp.Net MVC at the KaizenConf (FubuMVC evolved from theses opinions)