Thursday, May 29, 2008

How to install a ruby build - dependent on mysql

Download the build from SVN .

Pre-requisite

Tortoise svn is setup and is working properly.
Ruby and rake are installed.

Steps

1. In any directory, create a new folder. Rename it to something like "Test build version 0.5 build 1".
2. Right click on the folder and select "SVN checkout" from the menu.
3. In the pop-up "Checkout", make sure the "URL of repository" field has the correct data.
4. Now in the "Revision" heading, select the "Revision" check box and enter the revision number (say "333").
5. Click on "ok".

Result:
The build gets downloaded to the new directory you created in step 1.

Configuring the build.

1.  Now go to the directory
"Test build version 0.5 build 1". Navigate to config->database.yml
2. Edit the file "database.yml".
3. Under the heading "development", change the database field to something like "Testdatabase_05_2".
4. Change the password to current password of "mysql database".
5. Save the file.

Creating the above database in mysql.

1. Open a command prompt and type the following command.

>mysql -uroot -proot123

Root is the user name.
root123 is the password.

Note that there is no space between -u and the username.

Here is the output from the command prompt.

Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 18
Server version: 5.0.51b-community-nt MySQL Community Edition (GPL)

Type 'help;' or '\h' for help. Type '\c' to clear the buffer.

Now type the following command "
create database Testdatabase_05_2".

mysql> create database Testdatabase_05_2
    -> ;
Query OK, 1 row affected (0.00 sec)

mysql>

Now we have created the database "
Testdatabase_05_2".

Populating the database with data (using rake)

1. open a command prompt.
2. Go to the directory where the build is downloaded. ie
"Test build version 0.5 build 1".
3. Run the rake command to populate the database "
rake db:schema:load ".
4. You will get some output which denotes that the database is populated.

Running the server.

1. Navigate to the directory where build is downloaded.
2. Run the ruby command to start the server.
eg:

E:
cd E:\ParasharBuilds\Parashar version 0.5 build 2
ruby script/server --port=3005

Monday, May 26, 2008

Eccentricities of xampp

Xampp asks you to secure the password.

After securing the password, what is the username to login to xampp website?

During securing of xampp, it only asks for the password

Solution:

The default user is "lampp"

If you used xampp to change the passwords, the user should still be "lampp"

Website: http://www.apachefriends.org/f/viewtopic.php?t=22869

Installing ruby on rails in linux - the easy way

Ruby was already present in the system.

To install rails, we have to install gems first.


Download gems, go to that directory, login as root

> su
Password:
and type as below.

ruby setup.rb

Now to install rails, we have to install a lot of gems first.
All this can be done automatically if you type

gem install rails --include-dependencies


Result is given below.

# gem install rails --include-dependencies
INFO: `gem install -y` is now default and will be removed
INFO: use --ignore-dependencies to install only the gems you list
Bulk updating Gem source index for: http://gems.rubyforge.org/
Bulk updating Gem source index for: http://gems.rubyforge.org/
Successfully installed rake-0.8.1
Successfully installed activesupport-2.0.2
Successfully installed activerecord-2.0.2
Successfully installed actionpack-2.0.2
Successfully installed actionmailer-2.0.2
Successfully installed activeresource-2.0.2
Successfully installed rails-2.0.2
7 gems installed
Installing ri documentation for rake-0.8.1...
Installing ri documentation for activesupport-2.0.2...
Installing ri documentation for activerecord-2.0.2...
Installing ri documentation for actionpack-2.0.2...
Installing ri documentation for actionmailer-2.0.2...
Installing ri documentation for activeresource-2.0.2...
Installing RDoc documentation for rake-0.8.1...
Installing RDoc documentation for activesupport-2.0.2...
Installing RDoc documentation for activerecord-2.0.2...
Installing RDoc documentation for actionpack-2.0.2...
Installing RDoc documentation for actionmailer-2.0.2...
Installing RDoc documentation for activeresource-2.0.2...
linux-edp6:/home/manoj/Documents/downlload movies/Ruby on rails/rubygems-1.1.1/rubygems-1.1.1 #