Trying out Sinatra on Windows

Posted November 9th, 2007 in General, Linux, Microsoft, Open Source, ruby, Web Design by ryan

I saw a lot of buzz about the new Sinatra web framework and decided I’d give it a try. I have a client now that has a simple site they need up now and then I can migrate them to Rails over time. When I saw how easy Sinatra looked, I thought I could give it a chance to see what it could do.

I installed Sinatra via RubyGems:
gem install sinatra -y

After that I created a simple file following the example:

require 'rubygems'
require 'sinatra'


get '/' do
"Now we're cooking with gas"
end

But much to my dismay, nothing happened when running this on my windows box. I instantly searched Google for “Sinatra on windows” and found the Google Group for Sinatra and a post explaining that Sinatra doesn’t run on Windows yet. As I read into the thread, I found someone had some suggestions for making it work.

John Bledsoe had the following suggestions:

My humble suggestion would be to remove the FileUtils#touch from
Sinatra::Server#tail and update Environment#prepare_loggers to
something like:

def prepare_loggers(logger = nil)
if logger.nil?
FileUtils.touch(Options.log_file)
logger = Logger.new(open(Options.log_file, 'w')
end
end

Making these changes allowed Sinatra to run, but it wouldn’t server the page. Instead it returned an error:

Fri Nov 09 16:26:26 -0800 2007: ERROR: undefined method `info’ for nil:NilClass

I made a post to the group and was promptly replied to! The general advice given is that it is a rapidly emerging framework undergoing a lot of changes and to check back soon.

More on testing Sinatra in Linux coming soon….

[Slashdot] [Digg] [Reddit] [del.icio.us] [Facebook] [Technorati] [Google] [StumbleUpon]

CI: Using RoR for ASP.Net – Success! (Sort of…)

Posted November 2nd, 2007 in .Net, C#, rails, ruby by ryan

In my continued quest to use Ruby to build my .Net apps, I have been successful using Ruby’s “sh” command to call the C# compiler (csc.exe) and successfully build my assemblies. I still have not gotten it to use MSBuild, but I’ve been lazily trying to use the .csproj files generated by Visual Studio, but it doesn’t seem to work. MSBuild acts like everything worked, however no files get changed. I guess I’ll actually need to take a look at building it with MSBuild and then incorporating that back into a Rake task.

[Slashdot] [Digg] [Reddit] [del.icio.us] [Facebook] [Technorati] [Google] [StumbleUpon]

Continuous Integration : Using RoR to manage my ASP.Net builds

Posted November 1st, 2007 in .Net, C#, General, rails, ruby by ryan

So I’ve started down the path of setting up continuous integration (CI). I’m working on a project now for a client that wants to be involved with the process as much as possible. The CI with a few other hacks will allow him to use the current working version of his website at anytime.

I started looking into some CI products and ended up watching a screencast on CI Factory. I was amazed at my initial reaction (yuuk!)! I’m not knocking CI Factory directly, rather the fact that I need to configure a product that will configure a suite of products for me sounded like something that would be overly complicated to maintain / use. This is not what I need to stay agile and keep a client involved.

So in my tinkering with RoR, I ran into CruiseControl.rb. This product was easy to install and I already had the required dependencies from my RoR work. It works out of the box for RoR, but needs a little love for building .Net apps.

I started out by deciding that I was going to continue to use MSBuild for building my projects and use CrusieControl.rb to do the CI and other tasks not including the actual build. This would allow me to continue to work in Visual Studio as normal without changing a development process already underway.

So far I have integrated Rake into Visual Studio, created a rake file in my solution and created a task to build my projects. It works great from the command line (rake dotnet_build) but when calling from CruiseControl, it throws an error that is probably complaining about not having resgen.exe in the path – that will be taken care of soon and I plan on publishing a full post on each step in the near future.

I am very excited by the possibilities that Rake and Ruby bring to my .Net development. I’m already thinking of how to integrate this with the new IIS 7 API to have a Capistrano like feel to deploying my ASP.Net apps.

[Slashdot] [Digg] [Reddit] [del.icio.us] [Facebook] [Technorati] [Google] [StumbleUpon]
FireStats icon Powered by FireStats