O peixe no muelle RSS

Algunas cosas que me interesan sobre mi profesión y sobre la parte geek, freak, 2.0 o como quieras llamarle de mi vida. A veces se mezclan.

pablopr(arroba)gmail(punto)com

Mi CV público

Archivos

Blog AzulNeon
Félix tumblr
Blog BHR
    Sep
    9th
    Thu
    permalink
    |
    Sep
    6th
    Mon
    permalink
    |
    May
    3rd
    Mon
    permalink
    |
    Oct
    26th
    Mon
    permalink
    |
    Oct
    9th
    Fri
    permalink
    |
    Oct
    4th
    Sun
    permalink

    Installing Spree on Site5 with Passenger

    I’ll show you how I’ve installed Spree ecommerce on Site5 servers.

    Install Your Own Gems

    First, you need to tell RubyGems where to install your own custom gems since Spree is not preinstalled on Site5’s servers.  SSH into your site then,edit or create the file ~/.gemrc with the following content (with, of course, your username in place of username):

    gemhome: /home/username/ruby/gems
    gempath:
    - /home/username/ruby/gems
    - /usr/lib/ruby/gems/1.8

    Although not required for the basic installation, some of the rake tasks depend upon the shell variables $GEM_HOME and $GEM_PATH. It’s not a bad idea to add them to your .bash_profile like so:

    export GEM_PATH=/home/username/ruby/gems:/usr/lib/ruby/gems/1.8
    export GEM_HOME=/home/username/ruby/gems

    Install the Radiant Gem and Unpack the App

    Now this is very simple:

    gem update rake
    gem install --include-dependencies authlogic
    rake gems:install chriseppstein-compass
    gem install --include-dependencies spree

    Unpack the application using the spree command into the directory shop (it will create the directory if it does not exist).

    ~/ruby/gems/bin/spree --database mysql shop

    Configuration

    Now, you should have the new folder shop in your current directory. Using Site5’s SiteAdmin on your domain (located at yourdomain.com/siteadmin), create the databases spreedev, spreetest, and spreelive (note that your username_ is prepended to all those table and user names). Create a new MySQL user spree, and give it access to all functions on all those databases (watch out — those checkboxes to give privileges on the MySQL user page don’t mirror your current settings. To see that, you need to go to the databases page.) Once that is all completed, edit shop/config/database.yml with those settings; the file should look something like this:

    development:
    adapter: mysql
    database: username_spreedev
    username: username_
    spree
    password: pword
    host: localhost

    test:
    adapter: mysql
    database: username_
    spreetest
    username: username_
    spree
    password: pword
    host: localhost

    production:
    adapter: mysql
    database: username_
    spreelive
    username: username_
    spree
    password: pword
    host: localhost

    Now edit the file radapp/config/environment.rb. You need to uncomment a line and add one more, so the following line (should be the 8th line down):

    # ENV['RAILS_ENV'] ||= 'production'

    becomes…

    ENV['RAILS_ENV'] ||= 'production'
    ENV['GEM_PATH'] = '/home/username/ruby/gems:/usr/lib/ruby/gems/1.8'

    Bootstrap your Database

    Okay! All of the config files are setup. Now in the radiant application folder, run the rake task to bootstrap the database. Answer the prompts to your liking.

    $ cd shop/
    $ rake production db:bootstrap

    Setup the Symbolic Link

    Just create the symlink and you’re done! From your home directory, just do this:

    mv public_html public_html_bak
    ln -s ~/shop/public ~/public_html

    Setup Passenger

    Just create the .htaccess file at shop/public/.htaccess , and edit it like this:

    PassengerEnabled on
    PassengerAppRoot /home/username/shop

    Restart passport, the easiest way. From shop directory type :

    touch tmp/restart.txt

    Now point your browser to http://your.website.com/. It should be Spree!

    To enter the admin page, go to http://your.website.com/admin. But we have a problem here with the https connection. So unless you have installed a ssl certificate, you will need to desactivate ssl also in production mode. To do so, you need to insert the next sentence on your production database:

    INSERT INTO `username_spreelive`.`preferences` (`id`, `attribute`, `owner_id`, `owner_type`, 
    `group_id`, `group_type`, `value`, `created_at`, `updated_at`) VALUES ('1',
    'allow_ssl_in_production', '1', 'Configuration', NULL, NULL, '0', NULL, NULL);

    |
    Sep
    21st
    Mon
    permalink
    |
    Apr
    30th
    Thu
    permalink

    Spring Roo, prometedor

    Esta semana se espera saldrá la primera release de Spring Roo (todavía no se conoce el nombre definitivo), una alternativa a Grails, Rails, Django… que se presenta con muchas ventajas para los javeros más tradicionales. Y no solo para ellos. Es el primero de estos frameworks ágiles totalmente sobre Java. Una pequeña prueba de su funcionamiento:
    Introducing Spring ROO

    |
    Nov
    27th
    Thu
    permalink
    Eclipse hot-deploy is frozen sometimes… aaaaaaaaah
    Nov
    17th
    Mon
    permalink

    Spring weekend

    Este fin de semana me dio por conocer un poco más Spring (ahora que Struts2 y yo nos hemos hecho casi amigos). Después de casi un par de años usando Spring en el trabajo no podía decir que fuese ni de lejos un experto en la materia, es más, ni siquiera podía decir que conociese todas las posibilidades que ofrece este Framework. Y eso no puede ser, es como un piloto de rallies que no pase de 4ª (es el mejor símil que se me ocurrió :S).
    No voy a resumir en estas líneas lo que he sacado en claro, solo dejo algunos enlaces interesantes que encontré:
    Spring 2.x AOP Tutorial
    Dependency injection
    Aspect-oriented programming en Wikipedia
    El más completo es el que explica el patrón Dependency injection en Spring.

    |