Computer How To How To, Tutorial, Example, Review

  1. `require’: cannot load such file — openssl (LoadError)

    March 9, 2012 by Computer

    When your ruby and rails tools are installed, you will need to create a rails project. To do this use the rails command

    rails new /var/www/rails-project

    The following error was noticed when trying to create a rails project

    /usr/local/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:36:in `require': cannot load such file -- openssl (LoadError)

    The problem is that the openssl-devel package was missing from our system. Often times linux systems contain the openssl package, however, this does not contain the correct header files that are necessary. The openssl-devel package luckily has everything needs, and is generally a good thing to install. This package can easily be installed using

    yum install openssl-devel

    The issue now is that ruby requires that this package be present during installation. Meaning we will need to re-install ruby and ruby gems. Perform the installation process again

    For the ruby installation

    ./configure --prefix=/usr/local
    make install

    And to install ruby gems, change directory to the ruby gems package and

    ruby setup.rb

    Now we can execute the rails new command once again. After successful installation of the project, you should see

    Your bundle is complete! Use `bundle show [gemname]` to see where a bundled gem is installed.

    Now you can begin your ruby and rails development. See you project install directory for more details.

  2. PackageKit ERROR:dbus.proxies:Introspect error

    by Computer

    This error message appears when PackageKit is malfunctioning. It continually shows up in your yum package manager output

    ERROR:dbus.proxies:Introspect error on :1.167:/org/freedesktop/PackageKit: dbus.exceptions.DBusException: org.freedesktop.DBus.Error.AccessDenied: Rejected send message, 1 matched rules; type="method_call", sender=":1.935" (uid=0 pid=18850 comm="/usr/bin/python) interface="org.freedesktop.DBus.Introspectable" member="Introspect" error name="(unset)" requested_reply=0 destination=":1.167" (uid=0 pid=11720 comm="/usr/sbin/packagekitd))
    Unable to send message to PackageKit

    Not very nice. It also causes a hang for a while. It also appears there is some kind of communication error between the PackageKit and freedesktop.

    First let’s verify we have this package installed on our system:

    [root@computer www]# rpm -qa | grep Package

    Looking at yum, we can see this set of packages have minimal dependencies, so we should be fine to remove it if not needed.

    [root@computer www]# yum remove PackageKit*
    Loaded plugins: fastestmirror, refresh-packagekit
    Setting up Remove Process
    Resolving Dependencies
    --> Running transaction check
    ---> Package PackageKit.i686 0:0.5.8-19.el6.centos set to be erased
    --> Processing Dependency: PackageKit >= 0.5.0 for package: gnome-packagekit-2.28.3-3.el6.i686
    ---> Package PackageKit-device-rebind.i686 0:0.5.8-19.el6.centos set to be erased
    ---> Package PackageKit-glib.i686 0:0.5.8-19.el6.centos set to be erased
    ---> Package PackageKit-glib-devel.i686 0:0.5.8-19.el6.centos set to be erased
    ---> Package PackageKit-gtk-module.i686 0:0.5.8-19.el6.centos set to be erased
    ---> Package PackageKit-yum.i686 0:0.5.8-19.el6.centos set to be erased
    ---> Package PackageKit-yum-plugin.i686 0:0.5.8-19.el6.centos set to be erased
    --> Running transaction check
    ---> Package gnome-packagekit.i686 0:2.28.3-3.el6 set to be erased
    --> Finished Dependency Resolution
    Dependencies Resolved
     Package                          Arch         Version                       Repository     Size
     PackageKit                       i686         0.5.8-19.el6.centos           @base         2.2 M
     PackageKit-device-rebind         i686         0.5.8-19.el6.centos           @base         229 k
     PackageKit-glib                  i686         0.5.8-19.el6.centos           @base         715 k
     PackageKit-glib-devel            i686         0.5.8-19.el6.centos           @base         441 k
     PackageKit-gtk-module            i686         0.5.8-19.el6.centos           @base         229 k
     PackageKit-yum                   i686         0.5.8-19.el6.centos           @base         493 k
     PackageKit-yum-plugin            i686         0.5.8-19.el6.centos           @base         222 k
    Removing for dependencies:
     gnome-packagekit                 i686         2.28.3-3.el6                  @base         7.8 M
    Transaction Summary
    Remove        8 Package(s)
    Reinstall     0 Package(s)
    Downgrade     0 Package(s)

    Now from this point on you shouldn’t see any of the introspect error messages in your yum command. If you wish you can re-install the PackageKit set of tools again. This may resolve the issue since it is likely the error originated from some corruption during the original installation of PackageKit.

  3. Ruby on Rails Quick Start

    February 23, 2012 by Computer

    Installing ruby on rails requires a few steps, the first of which is installing the ruby framework. Ruby is a programming language that can be downloaded and installed from the ruby website. We recommend compiling from source, since it will tailor the installation to your system’s specifications. Or, you can install the copy from your local machine’s package manager. Below is an example of a seource install

    tar –xzvf ruby-1.9.3-p0.tar.gz
    cd ruby-1.9.3-p0
    ./configure --prefix=/usr/local
    make install

    Next you will need to install the rubygems application. Ruby gems is the package manager for the ruby platform, and can be easily used to install various ruby packages. This would be similar to the perl CPAN, but ruby’s implementation of it. After you download and unzip rubygems install it in the following manner

    ruby setup.rb

    Now you should be able to invoke the “gem” command. If you installed your ruby into /usr/local, then it should already be in your path

    [root@computer rubygems-1.8.17]# which gem

    Next we will need to install the rails framework, hence ruby on rails. Rails is easily installed via the gem package manage we installed previously. Install rails as follows

    gem install rails

    All gems needed for the rails framework will be installed accordingly.

    Successfully installed mail-2.4.1
    Successfully installed actionmailer-3.2.1
    Successfully installed thor-0.14.6
    Successfully installed rack-ssl-1.3.2
    Successfully installed railties-3.2.1
    Successfully installed bundler-1.0.22
    Successfully installed rails-3.2.1
    28 gems installed

    Now we can create our first rails project using the “rails new” command as follows

    rails new /var/www/rails-test
          create  README.rdoc
          create  Rakefile
          create  .gitignore
          create  Gemfile
          create  app
          create  app/assets/images/rails.png
          create  app/assets/javascripts/application.js
          create  app/assets/stylesheets/application.css
          create  app/controllers/application_controller.rb
          create  app/helpers/application_helper.rb
          create  app/mailers

    Any dependencies that are needed for the project will be installed at this time. And from here on out, your rails project can be developed upon.

    At this point you are ready to start your project. Enjoy the ruby on rails fun.

  4. Upgrade Ubuntu 10 to Ubuntu 11

    January 27, 2012 by Computer

    The Ubuntu operating system makes fantastic use of the latest features and abilities. One of the ways it is able to establish this is through effective package management. Including providing a robust repository of various packages, and implementing an easy to way to integrate them into your system. One of these features includes seamless upgrades to the operating system.

    If you are running Ubuntu 10 and you want to upgrade to Ubuntu 11 without re-installing then you can use the following command:

    do-release-upgrade -d

    This will upgrade your distribution accordingly. Be sure to reboot the operating system after the upgrade for it to load the updated kernel.

    Ubuntu has great package manager and upgrading options that make it easy to perform tasks such as this. Keeping up to date with the latest packages and upgrades is recommended, since it helps to address numerous bugs and security concerns. If you would like to install other Ubuntu packages, but not upgrade the entire system, the “apt-get” tool can be used. Bellow is an example as to how to install a particular package using page get:

    apt-get install <package>

    Through the use of do-release-upgrade and apt-get, one can easily add/remove/upgrade packages.

  5. Amazon Mapreduce Overview

    January 19, 2012 by Computer

    Amazon provides mapreduce computation on their resources, which is a great option for many different types of computation. To get started you will need an amazon account. From a top menu bar you can select mapreduce. There will be a few steps to perform before you start:

    1. Define a Job Flow – Specify whether you want to run your application including a Hive Program, Custom JAR, Streaming, or Pig Program. Sample applications are also available for use.
    2. Specify Parameters – Next you will be prompted for input parameters such as Input Location, Output Location, A Mapper, A Reducer, and extra arguments. One can even read/write directly to Amazon S3, which is great for not being limited in space.
    3. Configure EC2 Instances – Now configure your EC2 Instances, which will perform the computation. You can select an instance type and number of instances you wish to compute on.
    4. Specify Advanced Options – Configure any advanced options such as ec2 keypairs, vpc subnet, s3 log path, debugging and keepalive parameters.
    5. Bootstrap Actions – you can choose to use or not use bootstrap actions. If you choose to use it action types will be prompted and can be configured accordingly.

    Amazon provides great flexibility and cost savings when performing advanced computation using mapreduce.

  6. 10periodic not found in Ubuntu

    January 16, 2012 by Computer

    You may notice the 10periodic file is not available in the /etc/rc3.d directory. If it does not exist you will need to install the package that uses it.

    apt-get install unattended-upgrades update-notifier-common

  7. What package contains org.debian.apt.policy

    by Computer

    To get the org.debian.apt.policy you will need file you will need to install the following package

    apt-get install aptdaemon

    You will then be able to find the target file under the /usr directory tree. Use the “find” command to find the exact location.

  8. Search Packages in Ubuntu

    by Computer

    To search packages in ubuntu you can use the “aptitude” command.

    aptidutude search package-to-find

    The aptitude command will return a listing of packages that contain what you are interested in finding.

    After this, one can install the package using

    apt-get install package

  9. Installing Network Manager in Ubuntu

    by Computer

    To install the NetworkManager application you can use the apt-get tool and install it as follows:

    apt-get install network-manager

    After the installation you should be able to see /etc/NetworkManager

  10. XFS exceeds msdos-partition-table-imposed maximum

    January 9, 2012 by Computer

    When creating XFS partitions using parted you may encounter the error sectors exceeds the msdos-partition-table-imposed

    Error: partition length of 5264917709 sectors exceeds the msdos-partition-table-imposed maximum of 4294967295

    The above error occurs if a msdos partition exists and you try to create a new partition over it.

    To resolve this issue you will need to remove the existing partition on the partition using the “rm” command in parted. Then try recreating the partition once more.

The field of computers is very vast and can somtimes be extremely challenging, but also very rewarding. One will often times encounter problems that they may not have the answer to. Problems don't always have solutions, but sometimes they do. And helpting to provide some of those solutions is our mission. It is our goal to provide helpful computer how to, tutorial, example, and review for the benefit of everyone.

Some funny jokes...
"Dating a girl is just like writing software. Everything's going to work just fine in the testing lab (dating), but as soon as you have contract with a customer (marriage), then your program (life) is going to be facing new situations you never expected. You.ll be forced to patch the code (admit you're wrong) and then the code (wife) will just end up all bloated and unmaintainable in the end."

"Once upon a time there was a DOS user who saw Unix, and saw that it was good. After typing cp on his DOS machine at home, he downloaded GNU's unix tools ported to DOS and installed them. He rm'd, cp'd, and mv'd happily for many days, and upon finding elvis, he vi'd and was happy. After a long day at work (on a Unix box) he came home, started editing a file, and couldn't figure out why he couldn't suspend vi (w/ ctrl-z) to do a compile."

Terms and Disclaimer