When installing Discourse (for development) on my Mac I get this error:
ERROR: While executing gem ... (Gem::FilePermissionError)
You don't have write permissions for the /Library/Ruby/Gems/2.6.0 directory.
How can I resolve this?
Thanks.
When installing Discourse (for development) on my Mac I get this error:
ERROR: While executing gem ... (Gem::FilePermissionError)
You don't have write permissions for the /Library/Ruby/Gems/2.6.0 directory.
How can I resolve this?
Thanks.
Did you run through the script install of Discourse here?
Are you running macOS Catalina? If that’s the case, it sounds like you’re running into Discourse trying to use the system version of ruby. You’ll want to use something like rbenv to set your ruby version to avoid this.
I am running MacOS Catalina. And I did run that script but it failed half way through because it was installed I think.
Can you paste the output of which rbenv?
And do you have a custom .bashrc or .zshrc?
/usr/local/bin/rbenv
Not really sure. I don’t think so but maybe.
Can you cd into your discourse directory and share the output of which ruby?
Oops, didn’t notice. I did it and got /usr/bin/ruby
Okay, so you’re using the system ruby for Discourse which is why you’re getting that issue.
Check the PATH variable by typing in echo $PATH. You should see /Users/<your username>/.rbenv/bin and /Users/<your username>/.rbenv/shims listed in there.
If not, add them in your shell’s configuration file .bashrc or .zshrc. For ZSH you can add it like this: export PATH=/path/number/1:/path/number/2:$PATH
If you do see them, check to see what order they’re in. If they are later in the chain, they’re probably not getting loaded before the system ruby meaning the system ruby is being used for Discourse. You can use the same approach above for moving the paths further up the chain.
I thought @david added a Ruby version check to our dev environment stuff? 
I believe that was for the theme cli.
Is there some way to add an equivalent check here?
I think we already check in Discourse for ruby version compatibility — the issue here is our Discourse bundle can’t write gems for the system level version of ruby bundled with macOS. I could be wrong on the specific details but I think it has to do with a change Apple made with macOS Catalina. I ran into this same issue myself and it took a good deal of troubleshooting to figure out.
OPと同じエラーが発生しました。
これを読んでください:
これは実際にはファイル権限のエラーではなく、インストーラーが間違った場所を見ていたのではないかと考えました。
ターミナルを再起動すると.zshrcファイルが再読み込みされることを知っていたので、ターミナルを閉じて開き直しました。
インストールスクリプトを再度実行したところ、このエラーは発生しなくなりました。
この問題は、インストールプロセス中に戦略的に配置されたターミナルのリフレッシュで解決できますか? ![]()