Skip to content

Commit ba5a228

Browse files
authored
Merge pull request #156 from ahmadine/patch-1
Fix LoadError on some non-rvm environments
2 parents c8bb3e3 + e68fec2 commit ba5a228

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)