Skip to content

Commit e68fec2

Browse files
authored
Fix LoadError on some non-rvm environments
Fixes #146. See also opal/c_lexer#1 for some discussion on the issue.
1 parent c8bb3e3 commit e68fec2

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

lib/sassc/native.rb

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,11 @@ module Native
77
extend FFI::Library
88

99
dl_ext = (RbConfig::CONFIG['host_os'] =~ /darwin/ ? 'bundle' : 'so')
10-
ffi_lib File.expand_path("libsass.#{dl_ext}", __dir__)
10+
begin
11+
ffi_lib File.expand_path("libsass.#{dl_ext}", __dir__)
12+
rescue LoadError # Some non-rvm environments don't copy a shared object over to lib/sassc
13+
ffi_lib File.expand_path("libsass.#{dl_ext}", "#{__dir__}/../../ext")
14+
end
1115

1216
require_relative "native/sass_value"
1317

0 commit comments

Comments
 (0)