format internet:

…please wait (39% completed)…

Posts Tagged ‘ruby madrid’

Happy 4th birthday ASPgems

Posted by javier ramirez on June 6, 2010

Four years ago I thought I was at the top of my career. The company I had co-founded was starting to look much like a nine to five job and I decided to resign and accept a great position as a post-sales engineer in FatWire, where I would have the chance to improve their content server solution, which in my opinion was the best of the market by then. Things were looking sweet: new challenges, smart jobmates, important clients, interesting salary… and then I got an IM from Ana Isabel that changed it all (you gotta love it was not a phone call, mind you)

She told me about this brand new tiny company she was starting up together with Agustin Cuenca and some other folks I didn’t know by then, and who resulted to be brilliant. The idea was to be an Application Server Provider and offer products in the later so-called cloud to help small and medium size companies manage their businesses. They would also develop web applications for third parties. And they would do it all using this new toy called Rails, after a successful proof of concept for a real client by Xavier Noria. Regarding project management, they didn’t want to use a traditional approach, but going down the Agile road and use Scrum. The name of the company was ASPgems, where ASP stands for Application Server Provider and “gems” was something related to this Rails thing.

I was very reluctant to join them. Apart from having just landed into a great job position, I had a lot of doubts about the new company. They didn’t have any money, so I would have to cut down my salary and trust the company would eventually make it; they were working remotely, so I thought nothing would get really done; they didn’t have any big clients, and I came from the banking/public sector/corporate world; and to top it all they were using this Ruby on Rails framework and these requirementless agile methodologies.

My first experience with Ruby, some years before, was painful. I had to make some kind of automatic web crawler and I found libraries for doing it both with Ruby and Jython. I didn’t knew any of them so I tried them both. Right now I don’t remember why I didn’t choose the Jython library, but I know why I didn’t choose Ruby. After half a day trying, it was impossible to make the thing work on my windows machine, and all the documentation was in Japanese, so good luck with it. I finally coded my own crawling solution in good old Java and XML.

So you can imagine I was skeptical about Ruby. Then I started to read about Ruby and Rails and I panicked: no static type check, lack of hosting options, poor windows support, opinionated instead of configurable, with a certain disdain for the database layer… my Java instincts were alerting me with a lot of red signals. And then I made “the mistake” of having lunch with Ana and Agustin. They were really excited about the company, they saw a world full of possibilities, and the sense of adventure was just too strong for me to resist. Besides Agustin had been the guy who started Qarana, the best company I had worked for until then. It was just natural for me to join ASPgems.

By adopting Rails as her development framework, ASPgems was making a statement: We don’t care what other people are doing, we want to use the best tools available with or without the support of the rest of the industry. Living up to that statement takes a lot of work. First you have to be sure you are using the best tools available, so you have to be scanning the surroundings all the time to see when it’s time to move to the new best thing. Besides, you have to keep up to date on all the changes and on the new libraries available. And of course in many occasions you will have to be the one building those libraries, because getting there first means no one did the work for you yet. This living on the edge thing can be really time consuming, but things get much easier when you find a friendly community sharing your passion. And in Ruby/Rails we are really lucky on that issue.

Today is ASPgems’ fourth birthday and I’ve been a part of the company almost from the first month. If I have to judge in terms of personal development, I can say without any doubts this is the best company I’ve worked for, and I guess that’s why I’ve stayed here longer than in any other place before.

Below are some of the things I have done in the last four years. Had I stayed in my safe Java corporate world, I’m not sure I wouldn’t have done some of these things, but I’m sure ASPgems inspired me to do most of them.

I have..

..attended more conferences (and camps, and other events) in the last four years than in the previous 10+ since I started working on IT.
..organized and presented talks in both national and international conferences a local ruby group
..curated an extensive online presence: blog, personal page, vimeo, slideshare, mailing lists, communities…
..greatly improved my google ranking, making my conventional CV irrelevant
..written a book

..learnt how to better manage web projects
..seen clients really happy to see their projects going live on time
..shared my knowledge with both clients and competition
..launched more web applications than I can remember

..taught ruby on rails
..introduced some friends to the Ruby on Rails/Agile world
..developed a taste for being an early adopter on new technologies
..adopted ruby on rails for my personal and freelance projects
..switched to linux
..bought several domains and rented my own VPS

..learnt about SEO and Analytics
..made websites scale, and learnt a lot during the process
..learnt a lot about IT (web servers, process monitoring, system set up and configuration…)
..improved vastly my skills on client-side web developent
..been wrong many times, and happy to learn from those mistakes

..helped to build one of the most solid development teams I have seen
..worked together with the commercial department, and not against it

..kept in contact with brilliant developers from all over the world
..started repositories in github and rubyforge
..collaborated in several open source projects

..realized money is just a secondary motivation

Happy birthday ASPgems, and thank you.

p.s. By the way, remember how skeptical I was about Ruby? I was wrong, and happy to be. Go try it by yourself!

Posted in aspgems, javier ramirez, madrid | Tagged: , , , | 7 Comments »

Slides and video for my talk “La herramienta de desarrollo definitiva” in conferencia rails 2009

Posted by javier ramirez on February 28, 2010

I just realized I still hadn’t published in my blog the slides and video of my talk “La herramienta de desarrollo definitiva” in conferencia rails 2009, back in november.

My talk was a reflection about web development and the relative importance of the development tools. I was defending the idea of the individual with good practices being much more important than the choice of a tool or another. I was also talking about why Ruby on Rails is very appealing for such an individual and why it’s still relatively hard to find companies using modern techniques in development.

I talked about which were the best practices I consider an “ultimate developer” should embrace, linking it to concepts found in geek literature such as The Mythical Man Month, The Cluetrain Manifesto, Microserfs o The Soul of a New Machine.

This material is published under a Creative Commons NonCommercial-Attribution-ShareAlike license 2.5

The video is divided in two parts:

Posted in conferences, conferenciarails, conferenciarails2009, javier ramirez, ruby, ruby on rails | Tagged: , , , , , | 3 Comments »

Multiple rubygems versions, GEM_HOME and GEM_PATH

Posted by javier ramirez on September 28, 2009

Installing rubygems is failrly easy and it’s great to have a package manager so you can forget about manually installing and upgrading the components you use. After installing a gem, you can require it from any ruby script and use it hassle-free. Well, given your ruby interpreter can find it.

When you install rubygems, a lot of default configuration is done behind the scenes. If you must see to believe, you can run

gem environment

do you believe me now?

Unless you are on windows, you have probably experienced already that gems can get installed in different locations. If using a superuser account, the global configuration will be used, but with a regular account gems install under your home directory.

If you are not careful about how you install your gems, or if you are using rake gems:install from regular accounts, you might end up installing the same version of a gem twice. That’s not only WET (not DRY, bear with me here) but it eats up your poor HD.

Things can get a lot worse than that. Suppose you are working with both JRuby and Ruby MRI. When you use rubygems from JRuby, it will try to use a different gem location by default. So, depending on how you are installing gems, you could have up to three different copies of exactly the same version.

And if you are on ubuntu and you upgrade from an old version of rubygems to the latest one —you will have to if you install Rails 2.3.4; if you are having problems you can read right here how to update it— you might be surprised that your gems are being installed *again*. The reason is under older versions the default location was “/var/lib/gems” and the latest one defaults to “/usr/lib/ruby/gems”.

Well, four different copies of ActiveRecord 2.3.4 are three and a half more copies than I wanted, mind you.

So.. how can we stop this gem install frenzy? Easy. Don’t use the defaults. Each of your installations is using default values, but they can be easily overridden with command line parameters or much more conveniently with environment variables.

Remember the title of this post? Can you see anything there that would make a good candidate for environment variables? That’s right, all the rubygems versions honor the GEM_HOME and GEM_PATH variables, so if they are set they will be used.

Depending on your OS, you can set these variables in different places. I’m on ubuntu and a bit lazy, so I chose the easiest, which is by adding this to my .bashrc file.

export GEM_HOME=/var/lib/gems/1.8
export GEM_PATH=/var/lib/gems/1.8

And now, no matter what I’m using: Ruby MRI, JRuby, or the latest rubygems, my already installed gems will be used, and the new ones will be put in the same place.

Saving the world is a hard job, but someone has to do it.

Posted in 1771, development, jruby, ruby, ruby, ruby on rails, ruby on rails | Tagged: , , , , , , | 5 Comments »

it’s not the framework, it’s you

Posted by javier ramirez on July 21, 2009

I’m getting tired already of the hype about Ruby on Rails and how it is better than any other framework past, present or future.

Sure Rails is a cute piece of software, and Ruby is a gorgeous language (supposing you are into programming languages, that is), but if you take a critical look at Rails, you could just say it’s another MVC framework.. Big deal.. And with some coupling issues between the layers too, which are fortunately being targeted on Rails 3.

Moreover, if you take a look at some of its components they could frankly be better. ActiveRecord, for example, is a wrapper ORM, which is implicitly tying you to the physical database layer, with one class per table, as opposed to a mapper ORM such as DataMapper or Hibernate. And the principle of least surprise is kind of a joke when it comes to some of the ActionView helpers and the parameters you have to pass along.

Still, as we like to say around here “Ruby on Rails mola infinito”, and it’s right now my favourite framework for non trivial web applications.

So.. what makes this framework so special? Is it only the absence of configuration and the sensible defaults? Would we sell ourselves for a couple of parlor tricks like those? Surely not.. specially with so many frameworks providing already sensible defaults. Come on, even in Java you can kind of forget about writing so much XML code if you make proper use of annotations and the like. No, it has to be something else.

Ruby on Rails has something that transcends the framework itself. It has you. The Mighty Developer. The Early Adopter. The Status Quo Challenger. The so-called Community —whatever that means.

Bottom line is, when I get together with people working with Rails, they are always in search of the holy grail of web development —or the nearest tavern, whatever comes first.. you have to love that kind of pragmatism. We like to break our assumptions, to learn new things and forget about the ones we already know.

We embrace Rails *today* but we are willing to embrace any other tool as long as we like it better. Do you remember the months before the Merb-Rails love affair? Half the Rails developers I know were already making eyes at Merb without the slightest hint of shame.

And by challenging the system, we are obliged to keep learning… and to find new ways to build the web. And instead of trying to make a carbon copy of what we did before, we like to start anew, because that’s where the fun is.

Sure you can argue this attitude is not the exclusive property of the Rails community. And I would second you on that based on theory.. but in practice, I have seen other some other communities lack this need of challenging. Maybe it’s because they have maturity models and certifications and black belts and whatnot…. And maybe having so many constraints is killing creativity; but fact is in some environments trying to take a step forward is seen as something odd, not desirable.

Rails will pass —or not— but as long as we keep alive the spirit of embracing change, we are entitled to be on the fun side of web development.

So, if you ask me, that’s the secret ingredient of Rails. Sure the language and the framework are cool, but the real power of Ruby on Rails is you.. and me.

update: please read the comments, since I was a bit ambiguous in the post and some points needed further explanation :)

Posted in internet, javier ramirez, madrid, ruby, ruby on rails | Tagged: , , , , , | 10 Comments »

Cucumber, Selenium, Webrat, and Windows

Posted by javier ramirez on April 27, 2009

I spent last Saturday hacking around with some really smart people in Madrid. It’s not widely known than in Spain there’s a thriving Ruby on Rails community -my guess would be a language thing- but if you take a look at some of the Rails patches, Hackfest winners or the official Rails documentation project, you would be surprised to see how many -and how good- contributions are coming from this side of the world.

Once in a while we like to get together and take code challenges, so we can learn from each other and eat pizza to match the stereotype ;)

Thing is I’m a Windows guy. I know I should be sorry, I know it’s for housewives (or househusbands for that matter), but that’s life. (disclaimer: I’m planning to switch to Ubuntu in the near future)

As you know, developing software in windows while entirely possible is a bit more difficult than in other systems, specially when it comes to compiling, forking and the like.

Last Saturday I was, as usual, the only windows at hand (the rest being a lot of Macs in different flavors and a lonely Ubuntu) and, as a part of the code challenge, I had to run some tests with Cucumber, Selenium and Webrat. Apart from libxml, that has been working flawlessly in my computer for months, no other binaries were involved, so you would think everything was working just fine.. well, think twice.

First problem was the test server couldn’t be started automatically. I didn’t investigate much about it (my guess being that a fork or a system call is being issued and Windows cannot cope with it) since it was easier just to start it manually before running the tests. Also it was faster, because it didn’t need to be started every time.

After this obstacle, when I was trying to run the tests, I was getting a cryptic Errno::EADDRNOTAVAIL message. At first I thought it was because of Selenium not being able to bind to the given port, but a quick test from the command line discarded that possibility.

I don’t know anything about webrat (yet) but as the song goes, with a little help from my friends I was able to locate the source of the problem. When connecting to remote control Selenium, Webrat is trying to bind to the address “″ and that’s something Windows doesn’t like.

All I had to do was opening the file “selecium_rc_server.rb” at the gem source and replacing “″ by “″.

I was told I can do this much more clearly at the Webrat config, but I tried it out and I still had the same problem. Taking a look at the Webrat code I would say the config param is not honoured system-wide, but truth is I was in a hurry and I didn’t researched it thoroughly. I had a challenge to solve after all ;)

Once I did this, all was hunky dory. Selenium started, the form fields were filled in, the tests were passing (or not) and the result was displayed on my not-ansi console. Bummer.

Believe me, cucumber is not half the fun without the colors in the output. Fortunately enough, google can tell you where to find lots of ansi-aware console replacements. Unfortunately enough console2, my favourite, is not one of those.

So, there, it took a bit of extra work but now you can also run this neat stack in your good-old windows box.

Posted in development, javier ramirez, madrid, madridrb, ruby, ruby on rails, ruby on rails | Tagged: , , , | 6 Comments »

Rails Hot Or Not. The Movie

Posted by javier ramirez on December 24, 2008

Una vez pasada la resaca de la conferencia Rails, y a punto de entrar en la resaca navideña, ya están subidos los videos de la conferencia rails 2008

Aunque pierde mucho enlatada, os dejo por aquí el video de la sesión Rails Hot Or Not

Y para que no se diga, también dejo la presentación que utilicé, convenientemente editada para que se vea en cada uno de los casos cuál fue el ganador elegido por la audiencia

Este material tiene una licencia Creative Commons Atribución-NoComercial-LicenciarIgual 2.5

Por supuesto, agradecer la participación y el buen rollo de los asistentes a la charla, que contribuyeron a que fuera un éxito.. aunque nunca llueva a gusto de todos ;)

searchwords: hot or not, conferencias, rails

Posted in conferences, conferenciarails, conferenciarails2008, development, javier ramirez, madrid, ruby on rails | Tagged: , , , , , , | Leave a Comment »

Rails HOT or NOT

Posted by javier ramirez on October 16, 2008

Este año en la Conferencia Rails voy a presentar la sesión “Rails Hot or Not”

La idea es sacar partido de que vamos a estar juntos más de 200 personas que trabajamos todos los días con Rails, para poder extraer algo de conocimiento colectivo de la comunidad. Lo que pretendo hacer con esta charla es obtener una lista actualizada de los plugins/gemas/librerías varias que a día de hoy preferimos los desarrolladores Rails a la hora de empezar un proyecto y porqué.

Por ejemplo, una de las comparativas podría ser: Attachment_fu vs. PaperClip

Para que la sesión sea lo más interesante posible, no quiero hacer yo la lista de librerías a evaluar, ni quiero sacarla de sitios algo desactualizados como la toolbox de working with rails, sino que prefiero que sea un reflejo de lo que realmente usamos a día de hoy para desarrollar.

Supongamos que os toca hacer una aplicación compleja con Rails (os pongo debajo una lista de funcionalidades como ejemplo). Me gustaría saber qué gemas,plugins o librerías (en el sentido más amplio, javascript/css también me valen) son los que usaríais para abordar este proyecto. Si vosotros me mandáis esa lista, lo que voy a hacer es categorizar los elementos que me mandéis para poder hacer la presentación con ellos y que así quede la comparativa interesante.

Lista de posibles funcionalidades: un buscador, generación de pdfs, caché, integración con APIs de terceros, generación/lectura de feeds, multi-idioma, carga significativa de Ajax, procesos de fondo de larga duración, volumen de envío de mails razonable, autenticación con roles, un backend, foros, chat, edición de texto con formato (al estilo redcloth o wysiwig), popups estilo lightbox, notificación de excepciones, captcha, control de spam, upload de ficheros, creación de thumbnails, creación de gráficas/informes, notificación de excepciones, mapas y geolocalización… además de la funcionalidad que se ve, está la que no se ve: tests, profiler para el código, framework css, framework js…

Para facilitar en lo posible la recopilación de librerías, enviadme vuestras listas a No seáis vaguetes y enviadme algo… así la charla será más interesante… y, ya puestos, como la conferencia empieza el 13 de noviembre, intentad enviarme la lista antes de que acabe octubre para que me dé tiempo a prepararla.

Publicaré el resultado de las votaciones en este mismo blog unos días después de la conferencia. Así podemos sacar todos partido.

searchwords: conferenciarails, conferenciarails2008, hotornot

Posted in conferences, conferenciarails2008, development, javier ramirez, ruby on rails | Tagged: , , , , , , | 2 Comments »

Bienvenida Ms libxml

Posted by javier ramirez on July 17, 2008

Charlie Savage necesitaba hacer uso intensivo de xml para su proyecto mapbuzz y, como ninguna de las soluciones que había en Ruby era realmente buena (falta de funcionalidades, lentitud…) decidió retomar libxml-ruby para ponerlo al día y dejarlo funcionando.

El resultado no puede ser más prometedor según lo que anuncia en su blog

Al fin vamos a tener un parser XML con validaciones, XSLT, XML Schema, DTD, XPath y rendimiento razonable… y funciona en windows, que no está nada mal “for the rest of us”.

searchwords: xml, libxml, parser, DOM, SAX, ruby xml validating parser

Posted in development, javier ramirez, ruby | Tagged: , , , | Leave a Comment »

Instalando Rails 2.1

Posted by javier ramirez on July 9, 2008

Rails 2.1 mola.. la verdad es que trae un buen puñado de funcionalidades interesantes… yo le estoy sacando ya partido, por ejemplo, a los dirty objects (molarían aunque sólo fuera por el nombre) que son especialmente interesantes en callbacks y observers.

Si te interesa saber qué trae de nuevo la 2.1, un punto de partida interesante —aunque pelín básico en algunas partes— es el libro gratuíto “ruby on Rails 2.1: what’s new” . Por cierto, el primer cambio que aparece en la página 22 fue un patch mío… como se puede ver, el cambio fue humilde, pero el autor no :p

..a lo que iba… que Rails 2.1 mola… si consigues instalarlo. En muchos casos, es suficiente con un simple

gem install rails

Si es tu caso, puedes dejar de leer… pero lo que viene a continuación te interesará si al ejecutar ese comando te has encontrado con este error

ERROR: Error installing activesupport:
invalid gem format

La primera reacción es imitar a enjuto mojamuto y gritar “noooooo.. interneeeeeeeeé”

Una vez pasado el shock inicial, intentas volver a instalar… y cuando ya ves que no, buscas en el plugin google a ver si hay suerte y por lo menos esto le pasa a alguien más… y, efectivamente, hay más gente a la que le pasa.

Después de intentar diferentes cosas, la que me ha funcionado a mí ha sido irme a la página de active support en rubyforge descargar el fichero de la gema, y hacer la instalación local con el comando

gem install activesupport –local activesupport-2.1.0.gem

..y ya con esta gema instalada, podemos proceder a

gem install rails

El resto de gemas se bajan y se instalan correctamente desde el repositorio remoto

searchwords: rails 2.1, ruby on rails, gem install, github source

Posted in development, javier ramirez, ruby on rails, ruby on rails | Tagged: , , , , | Leave a Comment »

[Q&A] Diferencia entre nil y empty

Posted by javier ramirez on July 5, 2008

Inauguro una nueva serie en el blog. Como sabéis, me gusta participar en las listas de correo para aprender de los gurús, y para echar una mano cuando puedo a la gente que tiene dudas.

De vez en cuando respondo a mensajes en las listas de correo que me parecen dudas genéricas. Otras veces contesto a problemas con los que me he encontrado antes y que no eran fáciles de encontrar en la documentación. Creo que puede ser interesante referenciar estos mensajes en el blog para darles un poco más de visibilidad.

Podrás encontrar todos esos posts marcados con el tag y la categoría format_internet_q&a

En este primer caso de la serie, alguien planteaba cuál es la diferencia entre nil y empty. En concreto, quería entender porqué pasaba esto

x = ""
=> ""
=> false
=> true

Puedes encontrar debajo mi contestación a esta pregunta

> soy nuevo en ruby y me esta gustando mucho el lenguaje me gustaria que me dijeran que diferencia hay entre nil y empty

bueno.. aquí sería interesante si eres nuevo en ruby o si eres nuevo en cualquier lenguaje orientado a objetos. Te lo digo porque el equivalente a nil en muchos otros lenguajes (javascript, java, c++, c#…) es null.

voy a intentar hacer esto rápido.

ruby es un lenguaje muy orientado a objetos, hasta el punto de que todo es un objeto (a diferencia de otros lenguajes, que tienen tipos básicos a los que normalmente se llaman primitivas y luego objetos).

la forma normal de crear un objeto, es utilizar el método new de la clase correspondiente, por ejemplo

Cuando llamas a new, se asigna espacio en memoria para alojar un objeto de esa clase, se le asigna internamente un id, y se guarda la referencia a ese objeto en una tabla que ruby lleva internamente. En la línea anterior, verás que hemos creado un Array, pero ni guardamos en ningún sitio una referencia a ese array, no podremos hacer nada con él. Aquí es donde entran en juego las variables. Si haces

Estás creando un objeto, que se guarda internamente en la memoria, y además estás creando una variable llamada a, que apunta a la referencia de ese objeto en la memoria. De esta forma, cada vez que tu haces algo como


realmente lo que estás haciendo es invocar al método size del objeto al que apunta a. Ahora si haces

Tienes dos variables, pero las dos apuntan al mismo objeto, de forma que si modificas tanto a como b, estás modificando el mismo objeto.

Con esto lo que quiero que veas es que por un lado van los objetos, que es donde realmente se guardan tus valores y se ejecutan tus métodos, y por otro lado las variables, que simplemente valen para apuntar a esos objetos. Si creas un objeto y ninguna variable está apuntándole, ruby lo eliminará de memoria tan pronto como pueda, ya que es inaccesible y nadie lo va a usar.

Teniendo medio claro lo que es un objeto y lo que es una variable, es posible tener una variable que no apunte a ningún sitio. Esto a veces se llama una variable no inicializada (aunque en realidad no es el único caso en el que pasa). Cuando una variable no apunta a ningún sitio, apunta a nil.


Eso en muchos lenguajes es una variable que no apunta a ninguna parte. En Ruby es una variable que apunta al objeto nil (porque nil es también un objeto), pero la explicación te vale igual. nil se utiliza para indicar una variable que no apunta a ningún sitio, bien porque no se ha inicializado, bien porque se le ha asignado nil expresamente.

Si tú haces lo que decías en tu mail


x es una variable que está apuntando a un objeto que es la cadena “”. Al apuntar a ese objeto, puedes utilizar todos los métodos que da la clase String. Por ejemplo,puedes hacer


eso te va a devolver “”, porque la cadena “” en mayúsculas es “”, pero como ves, tienes un objeto String, que puedes usar como quieras. Por lo tanto, si haces


te va a decir “false”, ya que x no apunta a nil, sino a un objeto String vacío. Al estar vacío, si le pides


te va a decir que,efectivamente, la cadena está vacía. Sin embargo, no es nil, porque apunta a un objeto de tipo String que está referenciado en memoria.

Espero que te haya quedado medio claro.. si venías de un lenguaje orientado a objetos, seguro que ya sabes cómo va esto. Si no venías de un lenguaje orientado a objetos, quizás te valga la pena leerte algo de teoría de orientación a objetos para entender cómo funciona ruby. Te será especialmente útil para entender cosas como las variables de instancia, de clase, herencia, constructores, etc. Puedes programar sin conocer todo eso, pero vas a desaprovechar muchas de las funcionalidades disponibles.

puedes encontrar el hilo de este post en

searchwords: nil, empty, ruby programming language, garbage collector, object oriented programming

Posted in development, format_internet_q&a, javier ramirez, ruby | Tagged: , , , , , | 1 Comment »


Get every new post delivered to your Inbox.