martes, 1 de diciembre de 2009

Templates en Windows

Hello!

Acabo de crear un proyecto basado en un template de rails, como siempre, en entorno windows. La sitaxis es la conocida

rails nombre_de_proyecto --template=ruta_del_template

La ruta puede ser un path físico en la máquina o una url. He tenido que hacer un par de apaños muy fáciles sobre el template original para que todo funcione debidos, en su mayoría, a que ruby no es capaz de ejecutar archivos .bat si no le damos explícitamente la extensión:
  • Las llamadas a run 'gem ...' las he cambiado por run 'gem.bat ...'.
  • Las llamadas a rake las he cambiado por run 'rake.bat ...'.
  • He eliminado cualquier referencia a sudo en todas las llamadas a sistema.

El resto ha funcionado a la perfección. Ha costado más identificar el mensaje de error que otra cosa. Por cierto es éste:

c:/ruby/lib/ruby/gems/1.8/gems/activesupport-2.3.2/lib/active_support/core_ext/kernel/agnostics.rb:7:in ': Exec format error - rake db:create:all'

Me volverá a ocurrir esto mismo otra vez y me olvidaré. Lo saben aquí y en la República Democrática del Congo. ¡Salud y rocanrol!

Way down in Louisiana amongst the tall grown sugar canes
lived a simple man and a domineerin' hen and a rose of a different name.
The first time I fell lightly I was standing in the drizzlin' rain
with a trembling hand and a bottle of gin and a rose of a different name.
The devil made me do it the first time the second time I done it on my own.
Lord put a handle on a simple handed man and help me leave that black rose alone.

When the devil made that woman Lord she threw the pattern away.
She was built for speed with the tools you need to make a new fool every day.
Way down deep and dirty on the darker side of shame,
you caught a cane cuttin' man with a bottle of gin with a rose of a different name
The devil made me do it the first time the second time I done it on my own.
Lord put a handle on a simple handed man and help me leave that black rose alone.

No hay comentarios: