check out my new blog at gmarik.info/blog

Saturday, October 25, 2008

using rake with sudo

I was installing datamapper gems like:
gmarik@gm:master\dm-more.git$ sudo rake install
sudo: rake: command not found

sudo restricts environment settins:
$ sudo env|\grep PATH
PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin

As you can see rake path is not included:
$ which rake
/usr/local/lib/ruby/gems/bin/rake

You can edit sudo PATH to include /usr/local/lib/ruby/gems/bin.
=== UPDATED AT 2008.12.04 =====
or run rake with PATH set like:
sudo env PATH=$PATH rake

===============================
Bu i just symlinked rake:
$sudo ln -s `which rake` /usr/local/bin/

Now it works:
$ sudo rake --version
rake, version 0.8.3

Labels: , ,

0 Comments:

Post a Comment

<< Home