bigpotato
bigpotato

Reputation: 27507

Ruby + Ubuntu Without RVM: While executing gem ... (Gem::FilePermissionError)

I'm trying to install passenger on my server and it's not working:

    emai@web:/usr/local/current$ gem install passenger
    Fetching: daemon_controller-1.1.5.gem (100%)
    ERROR:  While executing gem ... (Gem::FilePermissionError)
        You don't have write permissions into the /usr/local/lib/ruby/gems/1.9.1 directory.

This will be a production server, and I don't want to change the path where the gems are stored and I don't think using sudo is a good idea, so is there another way to solve this?

Upvotes: 1

Views: 715

Answers (2)

Danil Speransky
Danil Speransky

Reputation: 30453

There is no way to do it without changing the path. You should do it under a user who has write permissions. Or change the path so that your user will have write permissions. It's the basis of the file system.

Upvotes: 0

Billy Chan
Billy Chan

Reputation: 24815

If you don't use rvm, you need to add sudo before it

$ sudo gem install something

Upvotes: 1

Related Questions