ruby / snap.ruby

Ruby snap
30 stars 5 forks source link

cannot snap-exec: cannot exec "/snap/ruby/200/bin/bundle": permission denied #23

Closed znz closed 3 years ago

znz commented 3 years ago

bundle of snap ruby 3.0.0 2020-12-26 (200) does not work.

vagrant@buster:~$ PATH=/snap/bin:$PATH
vagrant@buster:~$ ruby -v
ruby 3.0.0p0 (2020-12-25 revision 95aff21468) [x86_64-linux]
vagrant@buster:~$ bundle
cannot snap-exec: cannot exec "/snap/ruby/200/bin/bundle": permission denied

The shebang may be wrong.

vagrant@buster:~$ head -n1 /snap/ruby/[12]*/bin/bundle
==> /snap/ruby/189/bin/bundle <==
#!/snap/ruby/current/bin/ruby
==> /snap/ruby/200/bin/bundle <==
#!/root/parts/ruby/install//bin/ruby
hsbt commented 3 years ago

@znz Thanks.

I fixed it 201 revision. Can you try with 201?

ubuntu@primary:~$ head -1 /snap/ruby/201/bin/bundle
#!/snap/ruby/current/bin/ruby
znz commented 3 years ago

201's bundle failed with another error.

vagrant@buster:~$ bundle init
/usr/lib/ruby/vendor_ruby/rubygems/defaults/operating_system.rb:43:in `<top (required)>': uninitialized constant Gem::BasicSpecification (NameError)
    from /snap/ruby/201/lib/ruby/3.0.0/rubygems.rb:1348:in `require'
    from /snap/ruby/201/lib/ruby/3.0.0/rubygems.rb:1348:in `<top (required)>'
    from <internal:gem_prelude>:2:in `require'
    from <internal:gem_prelude>:2:in `<internal:gem_prelude>'
hsbt commented 3 years ago

It seems mixed with rubygems provided debian package.

znz commented 3 years ago

After export DEBIAN_DISABLE_RUBYGEMS_INTEGRATION=true and bundle install again, it resolved. thanks.

hsbt commented 3 years ago

It's nice to add DEBIAN_DISABLE_RUBYGEMS_INTEGRATION=1 to wrapper files of snap package, I think.