Saari Development

Ali Rizvi’s Technical Blog as a Professional Software Development Engineer

Archive for August 2007

Ruby : Where are the gems on ubuntu 7.04

without comments

It took me some time to figure it out where the gems are installed on my ubuntu 7.04 linux machine so I thought I would save it here as a reminder. The ruby gems are stored here:

/var/lib/gems/1.8/gems

What I did to find this is to run gem install without sudo to see the error message:

me@desktop:/usr/lib/ruby/1.8$ gem install rails
Bulk updating Gem source index for: http://gems.rubyforge.org
ERROR:  While executing gem ... (Errno::EACCES) 
Permission denied - /var/lib/gems/1.8/cache/rails-1.2.3.gem

The permission denied message gave me my answer. Who said error messages are not educational?

Hurray!

Written by imsaar

August 8, 2007 at 2:15 pm

Posted in linux/unix, ruby

MySQL and Rails: mysql.sock not found

without comments

I started doing my webapp on my brand new server (ubuntu linux 7.04) and when trying to run my first migration I got the following error message:

rake db:migrate(in /home/rizvi/projects/somewebapp)rake aborted!No such file or directory - /tmp/mysql.sock

Here is a useful mysql command to find out mysql defaults:

mysqladmin --print-defaultsmysqladmin would have been started with the following arguments:--port=3306 --socket=/var/run/mysqld/mysqld.sock

Here is what solved the problem:

sudo apt-get install libmysql-ruby

Note: The above is an alternative to :

sudo gem install mysql

Now I get:

rake db:migrate(in /home/rizvi/projects/somewebapp)rake aborted!Unknown database 'somewebapp_development'(See full trace by running task with --trace)

So I need to do the following:

mysqladmin -u root create somewebapp_development -pmysqladmin -u root create somewebapp_test -pmysqladmin -u root create somewebapp_production -p

Reference: RailsOnUbuntu

Written by imsaar

August 6, 2007 at 6:37 am

Posted in mysql, rails