-1

I recently switched over from windows pc to mac for development and i´m looking for some help regarding the terminal.

When i try to install compass wich is a ruby gem, i´m met with this error:

ERROR: While executing gem ... (Gem::FilePermissionError) You don't have write permissions for the /Library/Ruby/Gems/1.8 directory.

Is there a way for me to execute gem installments etc without doing sudo?

I found out that this "sudo chown -R $USER /usr/local" worked for npm. Now im looking for a way to do the same with ruby and yeoman.

4

1 回答 1

1

正如评论者所指出的,建议您尝试使用rvm或它的表亲,安装ruby到您的主目录中,这样,您默认不需要 root 来安装 gems,这是更广泛推荐的。

或者,您可以在这里尝试相同的chown技巧

尝试

sudo chown -R <username>:<username> /Library/Ruby/Gems

第二个通常是组名,可以跳过,也可以保留。

于 2013-08-11T08:59:36.620 回答