Loic
Loic

Reputation: 123

Ruby on Rails (Errno::EACCES)

I am getting the following error whenever I type any command on all my rails applications. I working on a virtual machine in cloud 9. Any idea or guidance?

(master) $ bundle exec rspec spec/
/opt/rh/ruby193/root/usr/share/rubygems/rubygems/specification.rb:541:in `read': Permission denied - /usr/libexec/openshift/cartridges/c9-0.1/root/lib/ruby/gems/specifications/multi_json-1.8.4.gemspec (Errno::EACCES)
        from /opt/rh/ruby193/root/usr/share/rubygems/rubygems/specification.rb:541:in `load'
        from /opt/rh/ruby193/root/usr/share/rubygems/rubygems/specification.rb:269:in `block (2 levels) in _all'
        from /opt/rh/ruby193/root/usr/share/rubygems/rubygems/specification.rb:268:in `each'
        from /opt/rh/ruby193/root/usr/share/rubygems/rubygems/specification.rb:268:in `block in _all'
        from /opt/rh/ruby193/root/usr/share/rubygems/rubygems/specification.rb:267:in `each'
        from /opt/rh/ruby193/root/usr/share/rubygems/rubygems/specification.rb:267:in `_all'
        from /opt/rh/ruby193/root/usr/share/rubygems/rubygems/specification.rb:410:in `each'
        from /opt/rh/ruby193/root/usr/share/rubygems/rubygems/dependency.rb:216:in `find_all'
        from /opt/rh/ruby193/root/usr/share/rubygems/rubygems/dependency.rb:216:in `matching_specs'
        from /opt/rh/ruby193/root/usr/share/rubygems/rubygems/dependency.rb:238:in `to_specs'
        from /opt/rh/ruby193/root/usr/share/rubygems/rubygems/dependency.rb:256:in `to_spec'
        from /opt/rh/ruby193/root/usr/share/rubygems/rubygems.rb:1231:in `gem'
        from /usr/libexec/openshift/cartridges/c9-0.1/root/lib/ruby/gems/bin/bundle:22:in `<main>'

Upvotes: 1

Views: 339

Answers (1)

New Alexandria
New Alexandria

Reputation: 7324

It sounds like your gems were installed with sudo access, which your current user (web runner?) lack the right perms to see the Ruby install dir.

I can't quite say why the gems were installed to a path like /usr/libexec/openshift/cartridges — perhaps this is part of your cloud host's setup?

  1. Do you boot your own rails server out of your instance? e.g. like you installed Unicorn, nginx, etc. on your own? If so, you can use rbenv to install a ruby and gemset to a local path over which you have full permission control.

If you don't have scenario #1 above, then the setup may be misconfigured by the host, and you should open a ticket.

Upvotes: 2

Related Questions