format internet:

…please wait (42% completed)…

Posts Tagged ‘spain’

SEO for developers

Posted by javier ramirez on March 10, 2010

As a web developer, my work involves much more than just coding; many times I find myself covering topics such as user experience, scalability, reliability of the system, or metrics and analytics to track the acceptance of a site.

SEO is left many times on the hands of the marketing team, but there are many technical aspects that are important in order to make a site appealing both for visitors and searchbots. Since web technologies (and search engines) evolve quickly, if you want to have a good site you need to keep posted about the latest developments. Sadly, there are a lots of materials based on outdated information and there are many myths and legends around the topic

I have been following closely the status of web crawling and indexing for some years, and we have been applying with success many of the practices I’ve learned to improve the sites of some clients. None of these practices involved links from external sites or bought traffic, just a better structure and changes of the contents and the sites’ internals.

Since we want to follow these practices in all the projects we are taking, I decided to prepare an internal training session for the ASPgems’ development team.

Here are the slides for my presentation. Even if they are not as good without the explanation (sorry, no video this time), I hope you’ll find them useful. UPDATE: video -in Spanish- has been uploaded to the media page of my blog.

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

If you find it interesting or if you are going to use it for any purposes, I’d appreciate an e-mail to jramirez@formatinternet.com

Posted in development, internet, javier ramirez, SEO, sites | Tagged: , , , , , | 10 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: , , , , , , | 6 Comments »