From e68fec238df62a718289d356663e43e219eca784 Mon Sep 17 00:00:00 2001 From: ahmadine <54514036+ahmadine@users.noreply.github.com> Date: Sep 18 2019 14:37:40 +0000 Subject: Fix LoadError on some non-rvm environments Fixes sass/sassc-ruby#146. See also opal/c_lexer#1 for some discussion on the issue. --- diff --git a/lib/sassc/native.rb b/lib/sassc/native.rb index 9664aae..3946b35 100644 --- a/lib/sassc/native.rb +++ b/lib/sassc/native.rb @@ -7,7 +7,11 @@ module SassC extend FFI::Library dl_ext = (RbConfig::CONFIG['host_os'] =~ /darwin/ ? 'bundle' : 'so') - ffi_lib File.expand_path("libsass.#{dl_ext}", __dir__) + begin + ffi_lib File.expand_path("libsass.#{dl_ext}", __dir__) + rescue LoadError # Some non-rvm environments don't copy a shared object over to lib/sassc + ffi_lib File.expand_path("libsass.#{dl_ext}", "#{__dir__}/../../ext") + end require_relative "native/sass_value"