Articles tagged 'rubygems'

  • Generating your site menu with the 'simple-navigation' gem

    January 3, 2012


    This post was originally published in the Rambling Labs Blog on January 3, 2012.


    One of the cool things I learned while building our new site was how to generate your site navigation menu without having to do the highlighting logic yourself.

    There’s a great gem out there for this called simple-navigation, which you can find on GitHub. It’s easy to set up and use, so you will probably do what you need to do really quick. To install, add it to your rails application Gemfile:

    gem 'simple-navigation'
    

    Then, run bundle install. After it’s installed, generate the configuration file for it, which will be the config/navigation.rb, with the following:

    rails generate navigation_config
    

    Go ahead and open the config/navigation.rb file, and add...

    Continue Reading →

  • 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 :).

  • 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

    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 →