sass / sassc-ruby

Use libsass with Ruby!
MIT License
367 stars 156 forks source link

Could not open library libsass.so: cannot open shared object file: No such file or directory (LoadError) #155

Closed mildred closed 4 years ago

mildred commented 4 years ago

When using sassc-2.2.0, I am getting the following error:

/usr/share/gems/gems/ffi-1.11.1/lib/ffi/library.rb:145:in `block in ffi_lib': Could not open library '/var/home/mildred/.gem/ruby/gems/sassc-2.2.0/lib/sassc/libsass.so': /var/home/mildred/.gem/ruby/gems/sassc-2.2.0/lib/sassc/libsass.so: cannot open shared object file: No such file or directory (LoadError)
    from /usr/share/gems/gems/ffi-1.11.1/lib/ffi/library.rb:99:in `map'
    from /usr/share/gems/gems/ffi-1.11.1/lib/ffi/library.rb:99:in `ffi_lib'
    from /var/home/mildred/.gem/ruby/gems/sassc-2.2.0/lib/sassc/native.rb:10:in `<module:Native>'
    from /var/home/mildred/.gem/ruby/gems/sassc-2.2.0/lib/sassc/native.rb:6:in `<module:SassC>'
    from /var/home/mildred/.gem/ruby/gems/sassc-2.2.0/lib/sassc/native.rb:5:in `<main>'
    from /usr/share/gems/gems/bootsnap-1.4.4/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:22:in `require'
    from /usr/share/gems/gems/bootsnap-1.4.4/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:22:in `block in require_with_bootsnap_lfi'
    from /usr/share/gems/gems/bootsnap-1.4.4/lib/bootsnap/load_path_cache/loaded_features_index.rb:92:in `register'
    from /usr/share/gems/gems/bootsnap-1.4.4/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:21:in `require_with_bootsnap_lfi'
    from /usr/share/gems/gems/bootsnap-1.4.4/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:30:in `require'
    from /usr/share/gems/gems/activesupport-5.2.3/lib/active_support/dependencies.rb:291:in `block in require'
    from /usr/share/gems/gems/activesupport-5.2.3/lib/active_support/dependencies.rb:257:in `load_dependency'
    from /usr/share/gems/gems/activesupport-5.2.3/lib/active_support/dependencies.rb:291:in `require'
    from /usr/share/gems/gems/bootsnap-1.4.4/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:48:in `require_relative'
    from /var/home/mildred/.gem/ruby/gems/sassc-2.2.0/lib/sassc.rb:31:in `<main>'
    from /usr/share/gems/gems/bootsnap-1.4.4/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:22:in `require'
    from /usr/share/gems/gems/bootsnap-1.4.4/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:22:in `block in require_with_bootsnap_lfi'
    from /usr/share/gems/gems/bootsnap-1.4.4/lib/bootsnap/load_path_cache/loaded_features_index.rb:92:in `register'
    from /usr/share/gems/gems/bootsnap-1.4.4/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:21:in `require_with_bootsnap_lfi'
    from /usr/share/gems/gems/bootsnap-1.4.4/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:30:in `require'
    from /usr/share/gems/gems/activesupport-5.2.3/lib/active_support/dependencies.rb:291:in `block in require'
    from /usr/share/gems/gems/activesupport-5.2.3/lib/active_support/dependencies.rb:257:in `load_dependency'
    from /usr/share/gems/gems/activesupport-5.2.3/lib/active_support/dependencies.rb:291:in `require'
    from /usr/share/gems/gems/sassc-rails-2.1.2/lib/sassc/rails.rb:5:in `<main>'
    from /usr/share/gems/gems/bootsnap-1.4.4/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:22:in `require'
    from /usr/share/gems/gems/bootsnap-1.4.4/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:22:in `block in require_with_bootsnap_lfi'
    from /usr/share/gems/gems/bootsnap-1.4.4/lib/bootsnap/load_path_cache/loaded_features_index.rb:92:in `register'
    from /usr/share/gems/gems/bootsnap-1.4.4/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:21:in `require_with_bootsnap_lfi'
    from /usr/share/gems/gems/bootsnap-1.4.4/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:30:in `require'
    from /usr/share/gems/gems/activesupport-5.2.3/lib/active_support/dependencies.rb:291:in `block in require'
    from /usr/share/gems/gems/activesupport-5.2.3/lib/active_support/dependencies.rb:257:in `load_dependency'
    from /usr/share/gems/gems/activesupport-5.2.3/lib/active_support/dependencies.rb:291:in `require'
    from /usr/share/gems/gems/sass-rails-6.0.0/lib/sass-rails.rb:1:in `<main>'
    from /usr/share/gems/gems/bootsnap-1.4.4/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:22:in `require'
    from /usr/share/gems/gems/bootsnap-1.4.4/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:22:in `block in require_with_bootsnap_lfi'
    from /usr/share/gems/gems/bootsnap-1.4.4/lib/bootsnap/load_path_cache/loaded_features_index.rb:92:in `register'
    from /usr/share/gems/gems/bootsnap-1.4.4/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:21:in `require_with_bootsnap_lfi'
    from /usr/share/gems/gems/bootsnap-1.4.4/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:30:in `require'
    from /usr/share/gems/gems/bundler-1.17.2/lib/bundler/runtime.rb:81:in `block (2 levels) in require'
    from /usr/share/gems/gems/bundler-1.17.2/lib/bundler/runtime.rb:76:in `each'
    from /usr/share/gems/gems/bundler-1.17.2/lib/bundler/runtime.rb:76:in `block in require'
    from /usr/share/gems/gems/bundler-1.17.2/lib/bundler/runtime.rb:65:in `each'
    from /usr/share/gems/gems/bundler-1.17.2/lib/bundler/runtime.rb:65:in `require'
    from /usr/share/gems/gems/bundler-1.17.2/lib/bundler.rb:114:in `require'
    from /var/home/mildred/Work/Codde/lcas/config/application.rb:7:in `<top (required)>'
    from /usr/share/gems/gems/spring-2.1.0/lib/spring/application.rb:92:in `require'
    from /usr/share/gems/gems/spring-2.1.0/lib/spring/application.rb:92:in `preload'
    from /usr/share/gems/gems/spring-2.1.0/lib/spring/application.rb:157:in `serve'
    from /usr/share/gems/gems/spring-2.1.0/lib/spring/application.rb:145:in `block in run'
    from /usr/share/gems/gems/spring-2.1.0/lib/spring/application.rb:139:in `loop'
    from /usr/share/gems/gems/spring-2.1.0/lib/spring/application.rb:139:in `run'
    from /usr/share/gems/gems/spring-2.1.0/lib/spring/application/boot.rb:19:in `<top (required)>'
    from /usr/share/rubygems/rubygems/core_ext/kernel_require.rb:54:in `require'
    from /usr/share/rubygems/rubygems/core_ext/kernel_require.rb:54:in `require'
    from -e:1:in `<main>'

It comes from the following line:

https://github.com/sass/sassc-ruby/blob/c8bb3e3be10aff7482dbc55fa5641aa7a0572ff7/lib/sassc/native.rb#L10

The problem is that the ruby code is looking in sassc-2.2.0/lib/sassc/libsass.so but the .so file is in sassc-2.2.0/ext/libsass.so.

mildred commented 4 years ago

Oops, this is #146 already.