gpt4 book ai didi

ruby - 安装 sassc 时出错,clang 编译器不支持 '-march=native' , M1

转载 作者:行者123 更新时间:2023-12-04 11:54:59 36 4
gpt4 key购买 nike

使用苹果硅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

最佳答案

根据 this answer在 sassc-ruby 上,这个标志作为当前的解决方法对我有用:

gem install sassc -- --disable-march-tune-native

关于ruby - 安装 sassc 时出错,clang 编译器不支持 '-march=native' , M1,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/66456656/

36 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com