teenHack42 teenHack42 - 1 year ago 104
Linux Question

when installing gems "Error: Permission denied rb_sysopen" Arch Linux

I am trying to install rails and I have already got ruby

$ ruby -v
ruby 2.3.1p112 (2016-04-26 revision 54768) [x86_64-linux]

when I run
gem install rails
I get

Building native extensions. This could take a while...
ERROR: While executing gem ... (Errno::EACCES)
Permission denied @ rb_sysopen - /usr/lib/ruby/gems/2.3.0/extensions/x86_64-linux/2.3.0/nokogiri-1.6.8/gem_make.out

then exactly the same thing if I try to install

I'm new to ruby/rails.
Thank you in advance

Answer Source

You are having a permissions issue attempting to open


Running this will most likely install correctly, but you may want to fix whatever the permission issue is instead:

sudo gem install rails