Articles tagged 'instructions'

  • The nokogiri gem and the "libxslt is missing" error

    October 17, 2011


    This post was originally published in the Rambling Labs Blog on October 17, 2011.


    I ran into this issue today. But this one’s easy. Just run the following command and install the gem again:

    apt-get install libxslt1.1 libxslt1-dev libxslt-ruby
    

    That’s it! It should work fine now :).

    Continue Reading →

  • Using Postgresql with Rails 3.1: the 'pg' gem

    October 17, 2011


    This post was originally published in the Rambling Labs Blog on October 17, 2011.


    As you may know I’ve been learning Ruby on Rails for the last few weeks. I’m also currently developing an application using the edge version of RefineryCMS (which is really a Rails 3.1 application), integrated with the almighty Heroku.

    I wanted to use RefineryCMS with Postgresql, so the only thing that I had to do was installing postgresql and it’s corresponding gem ‘pg’… Or so I thought.

    I wasn’t surprised. About a year ago I had the same unfulfilled expectations with mysql and the mysql gem. So, this is what I had to do:

    • First, of course, install postgresql with apt-get install postgresql
    • Then, install the libpq-dev with apt-get install libpq-dev. Note…

    Continue Reading →

  • Refinery CMS, rails 3.1.1 and the Operation not permitted error Errno::EPERM

    October 14, 2011


    This post was originally published in the Rambling Labs Blog on October 14, 2011.


    The last couple of days, I’ve been trying to set up Refinery CMS for a project I’m working on. I’ve made a couple of Stack Overflow questions about which ruby on rails CMS supports multiple languages and custom types.

    Answers to both questions were directing me to Refinery CMS, so I had to test it out. But… I wanted it to be on rails 3.1 (either 3.1.0 or 3.1.1). So I googled for a while and found that Refinery CMS edge on github does support rails 3.1.

    So I set up my Refinery CMS local test under my Ubuntu virtual machine by first downloading the edge code from github, like this:

    git clone git://github.com/resolve/refinerycms.git ~/refinerycms-edge
    

    Then…

    Continue Reading →

  • Rails 3.1 "rails console" fails with "no such file to load -- readline"

    October 12, 2011


    This post was originally published in the Rambling Labs Blog on October 12, 2011.


    Yesterday, I was trying to run the rails console command on Ubuntu with ruby 1.9.2 and rails 3.1, without any success. I was getting a no such file to load -- readline error. This kind of error was sort of familiar for me (I had the common no such file to load -- zlib and the not so common no such file to load -- openssl a while ago). So this was probably another package that I was missing.

    Turns out that as I found in a Stack Overflow question, I needed the libreadline-dev, which I didn’t have installed. But I also needed to recompile ruby, seriously!?

    This is where rvm comes to the rescue, and why I love so much to have rvm installed :D. You only need…

    Continue Reading →

  • Rails 3.1 smtp gmail Errno::ECONNREFUSED Connection refused

    October 9, 2011


    This post was originally published in the Rambling Labs Blog on October 9, 2011.


    I was trying out the rails 3.1 smtp mailer on the sandbox application I use to test all the new stuff and it was throwing this error:

    Errno::ECONNREFUSED in TestController#create
    
    Connection refused - connect(2)
    

    And I had this configuration on config/environments/development.rb:

    Demo::Application.configure do
      # ...
      config.action_mailer.delivery_method :smtp
      config.action_mailer.smtp_settings = {
        enable_starttls_auto: true,
        address: 'smtp.gmail.com',
        port: 587,
        domain: 'gmail.com',
        authentication: 'plain',
        user_name: '<email@yourdomain.com>',
        password: '<password>'
      }
      # ...
    end
    

    I tried quite a number of combinations for…

    Continue Reading →

  • Android Market not showing all installed apps

    October 9, 2011


    This post was originally published in the Rambling Labs Blog on October 9, 2011.


    As you may have read a couple of days ago, I had a lot of issues with the market when I installed Cyanogenmod7.1.0-RC1 on my HTC Inspire 4G. But thankfully, I solved that and I thought that was it.

    In the last few days though, I noticed that the apps weren’t updating as often as I was used to. So I went to check my apps on the market and, to my surprise, only 2 apps where showing there. 2 apps from a list of 50+ apps that I have currently installed.

    The first thought that popped into my mind was “I messed it up”. And of course that was going to be my first thought after all the issues I went through.

    But no need to worry! If you are having this issue, just…

    Continue Reading →

  • Rails 3.1 and the assert_select_jquery

    October 8, 2011


    This post was originally published in the Rambling Labs Blog on October 8, 2011.


    Diving a little into rails 3.1, I’m really liking some of the stuff I’ve found, like the easy Ajax integration for the views and the functional tests to ensure that the behavior of the controllers is the expected one.

    There is one particular method, assert_select_jquery, that I just don’t understand why it works how it works.

    Let’s say you have an Ajax request whose view to return is content.js.erb like this:

    if($('#container').is(':not(:visible)')) $('#container').show('blind', 1000);
    $('#container').html('<%= render @content %>');
    

    Ok, the page renders as expected, but, as you can see, this code is not too great. We’ll talk about that later. So, say you…

    Continue Reading →

  • Updating and/or uninstalling all installed gems

    October 8, 2011


    This post was originally published in the Rambling Labs Blog on October 8, 2011.


    I like to have an rvm gemset (see more about rvm) with the latest versions of all gems and I usually use this as my sandbox for testing out the latest features and issues of the gems. To update one gem to it’s latest stable version, you just have to run this:

    gem update GEMNAME
    

    The only problem is that for updating every gem you have installed, you have to remember each and every gem you have installed to pass it to the command… Nah, I’m just kidding. Just run the following command, and you’ll be fine:

    gem update `gem list | cut -d ' ' -f 1`
    

    UPDATE

    To uninstall all installed gems, it’s the same command with uninstall instead of update, like this:

    gem…

    Continue Reading →

  • Change cursor highlight color on Vim

    October 7, 2011


    This post was originally published in the Rambling Labs Blog on October 7, 2011.


    One of the first things I do when setting up my Vim on Ubuntu is download akitaonrails’ vimfiles, which has lots of cool stuff bundled. I like the dark theme that is set up (dark gray background and white foreground, and helps my sight issues).

    Normally the blinking cursor is white background and black foreground. I don’t really know exactly when or how it happened (maybe when I installed CommandT), but I lost the blinking cursor… I mean, I didn’t lose it.. It was there… But it was invisible. And that annoys me ‘cause I can’t tell where I’m at in the file.

    Thankfully, it’s an easy recovery. Just run what I found in Vim’s command mode:

    highlight Cursor guifg

    Continue Reading →

  • Android Market 3.1.3 and 3.1.5 crash with "Force stop" error on HTC Inspire4G/DesireHD with Cyanogenmod 7.1.0-RC1

    September 29, 2011


    This post was originally published in the Rambling Labs Blog on September 29, 2011.


    Yesterday, I installed the Cyanogenmod 7.1.0-RC1 on my HTC Inspire 4G phone. It looks and works great, but since the minute I installed it, I started to have issues with the Android Market, specifically versions 3.1.3 and 3.1.2.

    So, I googled for a couple of hours and didn’t find anything until, finally, I stumbled into this fix.

    Ok, that’s fair enough. A little hardcore for the stuff I usually do, but fine. I didn’t like that it was the 2.2.7 version, but I guess that was ok if it fixed it. I tried to find a newer version of the market, but only found ‘.apk’ files, and I needed a zip.

    Well, so I rebooted into recovery mode, wiped out all my data and…

    Continue Reading →