Archive for January, 2009

Why You should use “cd .”

January 29th, 2009 Comments off

Lately more and more I catch myself on entering

cd .

This is needed if You have open Yours console on a path that changes via linking or mounting, using “cd .” allows very fast switch to the new location that You should be using.

Categories: Linux Tags: , ,

Stop Software Patents Petition

January 27th, 2009 Comments off
Categories: News Tags: , , ,

Preparing Ruby on Rails environment – netbeans

January 25th, 2009 4 comments

In previous steps we have configured ruby and apache, now time to get development environment, there is wide range of tools but we will use Netbeans as it is … quite good.

So on beginning please download Netbeans, please go to it’s download site and get “C/C++” or “PHP” version – they are smaller from the ruby version, we need to update the environment after download so we would download many components again.

After download run the Netbeans installation, it is very simple so just follow the on screen instructions. When Netbeans is installed please run it and go to Tools Menu -> Plugins, there select available plugins and select:

  • Ruby and Rails
  • Ruby Extra Hints
  • Extra Ruby Color Themes

Do not install “Glasfish” or “JRuby” this is needed only for JRuby development which is not production ready, as some people think.

Additionally to installation You can perform update of the installed plugins in the Updates tab, after update and installation Netbeans will ask You to do restart to activate newly installed plugins, please follow it’s instructions.

When we have installed required plugins we can check that Netbeans sees our ruby installation, go to Tools Menu -> Ruby Platforms, here you will see yours ruby installations and it’s configuration, If you do not see any platform go threw the wizard under button Add Platform.

This is the development environmnet, in next part we will start a new project with it.

Categories: Development, Linux Tags: , , ,

Preparing Ruby on Rails environment – apache, ruby

January 24th, 2009 Comments off

In previous article I have described how to setup postgress for development, now is time to continue with the environment. At the beginning we need:

  • ruby as it is base for rails,
  • apache For serving pages,
  • java + netbeans for development.

So installation of required system packages:

emerge -qDNu ruby rubygems apache jdk

/etc/init.d/apache2 start

Install ruby gems that will be needed shortly:

UPDATE: 2009.01.26 added postgres

gem install rails capistrano capistrano-ext passenger postgres

Now we need to integrate passenger into apache – please run:


UPDATED 2009-02-06:

The installation should go without nay problems (If You followed all instructions), at the end You will be asked to modify apache configuration file – few Lines of the output – starting with LoadModule, PassengerRoot and PassengerRuby – should be copied to new apache configuration file, easiest way is to use this commands:

echo “LoadModule passenger_module /usr/lib64/ruby/gems/1.8/gems/passenger-2.0.6/ext/apache2/” > /etc/apache2/vhosts.d/01_passenger.conf

echo “PassengerRoot /usr/lib64/ruby/gems/1.8/gems/passenger-2.0.6” >> /etc/apache2/vhosts.d/01_passenger.conf

echo “PassengerRuby /usr/bin/ruby18” >> /etc/apache2/vhosts.d/01_passenger.conf

Some of the lines may differ from the output form yours passenger so please use Yours as it is better for you.

In next part we will continue with development environment.

Preparing Ruby on Rails environment – postgresql

January 20th, 2009 Comments off

Time to start some development, for next project I have decided to use (and learn) Ruby on Rails (RoR).

Many persons use mysql to develop rails apps, as it is easy to setup and use.

But postgresql has more futures then mysql, one of them is known to be used by current RoR, It is transactional DDL update, in Rails world it is called transactionall migrations.

So this is what I had to do to get it working on my gentoo box:

emerge postgresql-server

emerge postgresql-server –config

/etc/init.d/postgresql-8.3 start

su – postgres -c createuser mpapis

# or you could use: sudo -u postgres createuser mpapis

In the listing i have used settings from my computer, /etc/init.d/postgresql-8.3 can be any other name starting with postgres, replace mpapis with your user name.

After running those commands You are able to run psql from yours account, from now on You can run following commands to menage Yours postgresql database:

  1. createdb DATABASE_NAME
  2. dropdb DATABASE_NAME
  3. createuser USER_NAME
  4. dropuser USER_NAME
  5. pg_dump DATABASE_NAME > dump.sql
  6. pg_dumpall > dump.sql
  7. psql -d DATABASE_NAME

This knowledge should be enough to continue with rails, but this comes in next days.

Categories: Development, Linux Tags: , ,