July 29, 2008 at 10:55 pm
· Filed under Passenger, Ruby, Sinatra
Last week at work I gave a little lunchtime presentation on Sinatra (the coolest microwebframework on the block) to some co-workers. It went over well.
Over the last couple of weekends, I played around with Passenger (the artist formerly known as mod_rails) and set up a whole bunch of little sites. It went over well.
Then today I read about HTTParty (like a DSL for creating REST clients) and that went over well, too.
We can all be making tiny, simple REST applications (with Sinatra), putting them on the internet with, like, no configuration and in no time (with Passenger), and then consuming them after doing next to no work (with HTTParty).
The barriers to putting up and pulling down easy-to-use resources is practically non-existent. I’d like to find out what happens when we start taking advantage of that. Maybe it won’t change the world, but I bet it’ll be like the day you figured out how to effectively use pipes on the command line: totally awesome for you.
Permalink
July 4, 2008 at 12:13 pm
· Filed under Ruby, Sinatra
I’ve been playing around with Sinatra (it’s awesome!) and thought I’d deploy something to my mess-around DreamHost account. I followed these instructions which totally worked and was so easy. But when it came time to actually deploy my real app with real views, I got nothing but “Internal Server Error”.
Internal Server Error is not very informative, but if you’re seeing it when you’re calling views (like erb(:page)), you might need to change that to:
erb(File.read('views/page.erb'))
That stopped the errors and let my app work. Locally, there was no problem, and a cursory glance through Sinatra didn’t tell me why it worked here and not there. I guess I’m programming by accident this morning.
Update: I was able to get erb(:page) working by fixing the view path in my config.ru. In the options merged into Sinatra::Application.default_options, I added :views => '/path/to/app/views'. Before it was getting set to something like ‘path/to/app/Rack: /path/to/app/views’. tusho in #sinatra suggested that “Passenger is odd.”
Permalink