【发布时间】:2021-03-03 12:00:43
【问题描述】:
使用 Apple Silicon M1 机器。正在尝试安装 ruby gem gem install sassc -v '2.1.0'。
问题在于,clang 编译器还没有 Apple M1 的标志“native”。 Related
给出的错误:(注意我用'yournamehere'替换了我的名字)
Fetching sassc 2.1.0
Installing sassc 2.1.0 with native extensions
Gem::Ext::BuildError: ERROR: Failed to build gem native extension.
current directory: /Users/yournamehere/.asdf/installs/ruby/2.7.2/lib/ruby/gems/2.7.0/gems/sassc-2.1.0/ext
/Users/yournamehere/.asdf/installs/ruby/2.7.2/bin/ruby -I /Users/yournamehere/.asdf/installs/ruby/2.7.2/lib/ruby/2.7.0 -r ./siteconf20210303-14183-1uwhwj4.rb extconf.rb
creating Makefile
current directory: /Users/yournamehere/.asdf/installs/ruby/2.7.2/lib/ruby/gems/2.7.0/gems/sassc-2.1.0/ext
make "DESTDIR=" clean
current directory: /Users/yournamehere/.asdf/installs/ruby/2.7.2/lib/ruby/gems/2.7.0/gems/sassc-2.1.0/ext
make "DESTDIR="
compiling ./libsass/src/units.cpp
clang: error: the clang compiler does not support '-march=native'
make: *** [units.o] Error 1
make failed, exit code 2
Gem files will remain installed in /Users/yournamehere/.asdf/installs/ruby/2.7.2/lib/ruby/gems/2.7.0/gems/sassc-2.1.0 for inspection.
Results logged to /Users/yournamehere/.asdf/installs/ruby/2.7.2/lib/ruby/gems/2.7.0/extensions/arm64-darwin-20/2.7.0/sassc-2.1.0/gem_make.out
An error occurred while installing sassc (2.1.0), and Bundler cannot continue.
Make sure that `gem install sassc -v '2.1.0' --source 'https://rubygems.org/'` succeeds before bundling.
In Gemfile:
sassc-rails was resolved to 2.1.2, which depends on
sassc
【问题讨论】: