Arquivo por autor

(Português) Introdução ao jQuery

O jQuery é uma biblioteca JavaScript poderosa que está quase se tornando quase “sinônimo” do próprio JavaScript.

A apresentação de slides a seguir é de uma palestra introdutória do jQuery, que destaca praticamente todos os seus recursos e que mostra algumas modificações na versão mais recente da biblioteca (1.7).

 

E para quem quiser se aprofundar no assunto, o último slide aponta para um livro gratuito de jQuery: jqfundamentals.com.

(Registro aqui o agradecimento ao Erko Bridee por compartilhar esse conteúdo)

Fixing Windows/Linux boot after an Ubuntu update (Wubi)

Let me guess it: you arrived here because you installed Ubuntu via Wubi in some Windows box and, after a Linux update, you can no longer boot neither Windows or Linux, right?

First, calm down. The Ubuntu update didn’t know that your MBR had nothing about your Ubuntu “instalation”, then it worked on fixing something but just messed everythig.

To fix this, boot up your computer using a live CD (like the Ubuntu one) and execute the following in a terminal:

sudo apt-get install lilo
sudo lilo -M /dev/sda mbr

Voilá! Restart you PC without the Ubuntu disc and everything will work like a charm.

Tip: everytime your Ubuntu installation ask you to update, don’t worry to do so. Just do not forget to execute these commands BEFORE restart your system.

Deploying your Rails 3 app on Dreamhost

This is another quick post: to deploy your Rails 3 app on a shared hosting at Dreamhost, just use RVM to make sure your gems will have their place in the sun on the user’s directory (otherwise Passenger will throw an access denied to /root/.gems error) and then configure your Rails app for the new gems path. Here is the step-by-step:

1) Access your Dreamhost account via SSH.
2) Install RVM “as a user” (you won’t be able to try this as root). Here is the step-by-step).
3) Configure your app so Passenger will know where to find your gems, including these lines in config.ru at the beginning of the file:

ENV['GEM_HOME'] = '/path/to/your/gems'
require 'rubygems'
Gem.clear_paths

Where ‘/path/to/your/gems’ should be replaced by your GEM_HOME using RVM. Lets say you installed ruby 1.8.7 (using rvm install 1.8.7) and a gemset named mygemset, the path to your gems may look something like: /home/USER/.rvm/gems/ruby-1.8.7-p330@mygemset

Edit @ mar 6th, 2011: Yesterday, Dreamhost announced they already support Rails 3, and its current version at the time of this writing is 3.0.3

Fixing problems with Rails, RVM, openssl, and readline on Ubuntu

When you start working with RVM on Ubuntu, probably you’ll face some configuration problems while trying to execute script/console (Rails 2.x), e.g.:

no such file to load -- readline (LoadError)

or even

no such file to load -- openssl (LoadError)

The oficial RVM website offers one solution, but this may not apply for all situations.

To fix that problem, you’ll need to do the following:

1) Install openssl and readline libraries via apt:

$ sudo apt-get install libreadline6 libreadline6-dev openssl libssl0.9.8 libssl-dev libopenssl-ruby

2) Reinstal your ruby version using RVM, specifying readline and openssl directories:

$ cd <path to your Rails project>
$ rvm remove 1.8.7
$ rvm install 1.8.7 --with-readline-dir=/usr/include/readline/ --with-openssl-dir=/usr/include/openssl/

This example works with Ruby version 1.8.7 on Ubuntu 10. Make the proper changes to meet your environment. I’ve tested this solution with Rails 2.3.10 – I believe it will work with other versions/evironments as well.

Worked with you in another configuration? Just drop a line in the comments bellow and let me know!

(Português) Livro: Vá aonde seu coração mandar

Sorry, this entry is only available in Português.

(Português) Livro: Miguel Strogoff

(Português) Livro: Sob o olhar de Deus – memórias de um cirurgião

Sorry, this entry is only available in Português.

(Português) Livro: Eugenia Grandet

Sorry, this entry is only available in Português.

(Português) Filme: Le Concert

(Português) Tecnologia a serviço do circo eleitoral

Sorry, this entry is only available in Português.