Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Install eruby binary (example given is ubuntu/apache):

  sudo apt-get install ruby libapache2-mod-ruby eruby
Set up your web server to serve it:

  AddHandler rubypage .erb .xhtml
  Action rubypage /cgi-bin/eruby
Start writing pages like this:

  The time is <%= Time.now %>.
The first two steps could be completed by your web host, or done by you once. Obviously you might run into performance issues etc (no idea how well this would work on a live server), but that gets you up and running.

I would point out that most examples you can think of as trivial as that above could just be done with js anyway though, without any dynamic language server-side - the main reason to use a server-side language is to talk to a db or store data, at which point you probably want a framework anyway.

It's already a solved problem really, but people at that level are happy enough on PHP, which for the example above would be almost identical, and for anything more complex a framework is actually useful, and so there's no point in starting this way for many web projects.



As I recall a big issue with mod-ruby was that it used a single Ruby process for all scripts.

That meant if script A decides to rewrite, say, Array#include? to only work with symbols (or whatever), script B now has to live with it.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: