sudo driving me crazy!! (ruby, gem)

OK, I just installed Ruby EE on my new linode.

I am using Ubuntu 9.10 and it didn't have Ruby previously.

I have the following setup as my PATH in ~/.profile (both for my login account AND root)

/opt/ruby-enterprise-1.8.7-2009.10/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games

When I am root OR my login account (cbmeeks), I can:

ruby -v

at the command line and it works.

However, if I:

sudo ruby -v

I get a command not found?

The same is true for any bin in that /opt/ruby-…/bin folder.

sudo works just fine which makes me think the path is not being loaded with SUDO.

I can:

sudo /opt/ruby-enterprise-1.8.7-2009.10/bin/ruby -v

just fine.

Any tips? I've even rebooted the server.

Thanks!

4 Replies

Possibly due to the feature of sudo being compiled with either –env_reset or --with-secure-path. You should be able to get around the first with sudo -E (and SETENV in /etc/sudoers), and the latter by adding a line to your .bashrc, such as in this example.

Thanks. I will give that a shot.

@cbmeeks:

http://BitCircle.com

Now that is a clean, simple web page design.

James

lol.

Yeah, sorry. I have several domains. Part of the reason I was having trouble was that I reloaded my linode and decided to setup all of my virtual servers using Sinatra and serve my main app (coming soon) with Rails.

BitCircle.com now points to the correct virtual host. Using Sinatra now. :-)

Pretty sweet actually.

Reply

Please enter an answer
Tips:

You can mention users to notify them: @username

You can use Markdown to format your question. For more examples see the Markdown Cheatsheet.

> I’m a blockquote.

I’m a blockquote.

[I'm a link] (https://www.google.com)

I'm a link

**I am bold** I am bold

*I am italicized* I am italicized

Community Code of Conduct