FreedomBen / dory

Your development proxy for docker
MIT License
156 stars 24 forks source link

`require': cannot load such file -- /var/lib/gems/2.7.0/gems/dory-1.1.1/lib/dory/config (LoadError) #53

Closed adammpkins closed 2 years ago

adammpkins commented 3 years ago

Traceback (most recent call last): 9: from /usr/local/bin/dory:23:in <main>' 8: from /usr/local/bin/dory:23:inload' 7: from /var/lib/gems/2.7.0/gems/dory-1.1.1/bin/dory:7:in <top (required)>' 6: from /usr/lib/ruby/2.7.0/rubygems/core_ext/kernel_require.rb:92:inrequire' 5: from /usr/lib/ruby/2.7.0/rubygems/core_ext/kernel_require.rb:92:in require' 4: from /var/lib/gems/2.7.0/gems/dory-1.1.1/lib/dory.rb:1:in<top (required)>' 3: from /var/lib/gems/2.7.0/gems/dory-1.1.1/lib/dory.rb:1:in each' 2: from /var/lib/gems/2.7.0/gems/dory-1.1.1/lib/dory.rb:2:inblock in <top (required)>' 1: from /usr/lib/ruby/2.7.0/rubygems/core_ext/kernel_require.rb:92:in require' /usr/lib/ruby/2.7.0/rubygems/core_ext/kernel_require.rb:92:inrequire': cannot load such file -- /var/lib/gems/2.7.0/gems/dory-1.1.1/lib/dory/config (LoadError)

I am using Ubuntu 20.04 and installed this as a gem.

Alberto826 commented 3 years ago

I downgraded to dory:1.1.0 and this worked for me. I don't know what went wrong with 1.1.1

omarbirjas commented 2 years ago

Downgrading to dory:1.1.0 did not fix this. Im also on ubuntu 20.04.3.

FreedomBen commented 2 years ago

I haven't been able to reproduce this with dory, but I had a similar error happen with a different gem and after debugging I discovered that (with a system installed ruby version) some of the gem files were missing the read perms for non-owner/non-group. Since root:root owned, my regular user couldn't load them.

I did also get hosed partly at one point because I ran bundler as root. If that happens it can mess things up and you'll want a similar thing as below.

The fix:

On Fedora:

sudo chmod -R a+r /usr/share/gems/cache/
sudo chmod -R a+r /usr/share/gems/specifications/

On Ubuntu:

# For all gems, all ruby versions
sudo chmod -R a+r /var/lib/gems

# or for only one ruby version
sudo chmod -R a+r /var/lib/gems/2.7.0/gems

# or for only dory
sudo chmod -R a+r /var/lib/gems/2.7.0/gems/dory-1.1.1/

If that doesn't work, please let me know and I'll investigate further. Some helpful info:

cat /etc/os-release
which ruby
ruby -v