无法捆绑安装gem“sassc-rails”

问题描述 投票:0回答:1

这是我的第一个问题,如果解释得不好请原谅我。

我想在我的 gem 文件中添加 gem“sassc-rails”,但是当我捆绑它时,我的终端中出现错误

Fetching gem metadata from https://rubygems.org/.........
Resolving dependencies...
Using rake 13.1.0
Using base64 0.2.0
Using bigdecimal 3.1.4
Using concurrent-ruby 1.2.2
Using connection_pool 2.4.1
Using minitest 5.20.0
Using mutex_m 0.2.0
Using builder 3.2.4
Using erubi 1.12.0
Using ruby2_keywords 0.0.5
Using racc 1.7.3
Using crass 1.0.6
Using date 3.3.4
Using rack 3.0.8
Using websocket-extensions 0.1.5
Using public_suffix 5.0.4
Using bindex 0.8.1
Using bundler 2.3.7
Using matrix 0.4.2
Using nio4r 2.6.0
Using stringio 3.0.9
Using io-console 0.6.0
Using orm_adapter 0.5.0
Using webrick 1.8.1
Using thor 1.3.0
Using diff-lcs 1.5.0
Using error_highlight 0.5.1
Using ffi 1.16.3
Using pg 1.5.4
Using redis 4.8.1
Using rexml 3.2.6
Using rspec-support 3.12.1
Using rubyzip 2.3.2
Using tilt 2.3.0
Using websocket 1.2.10
Using i18n 1.14.1
Using marcel 1.0.2
Using mini_mime 1.1.5
Using msgpack 1.7.2
Using zeitwerk 2.6.12
Using bcrypt 3.1.20
Using drb 2.2.0
Using regexp_parser 2.8.2
Using sprockets 4.2.1
Using tzinfo 2.0.6
Using nokogiri 1.15.5 (arm64-darwin)
Using reline 0.4.0
Using rack-test 2.1.0
Using warden 1.2.9
Using timeout 0.4.1
Using rspec-expectations 3.12.3
Using rspec-mocks 3.12.6
Fetching sassc 2.4.0
Using puma 6.4.0
Using selenium-webdriver 4.15.0
Using bootsnap 1.17.0
Using activesupport 7.1.2
Using rspec-core 3.12.2
Using loofah 2.22.0
Using websocket-driver 0.7.6
Using psych 5.1.1.1
Using rack-session 2.0.0
Using rackup 2.1.0
Using activemodel 7.1.2
Using xpath 3.2.0
Using rails-html-sanitizer 1.6.0
Using addressable 2.8.5
Using rdoc 6.6.0
Using net-protocol 0.2.2
Using capybara 3.39.2
Using net-smtp 0.4.0
Using globalid 1.2.1
Using rails-dom-testing 2.2.0
Using irb 1.9.1
Using actionview 7.1.2
Using net-pop 0.1.2
Using debug 1.8.0
Using actionpack 7.1.2
Using net-imap 0.4.5
Using actioncable 7.1.2
Using mail 2.8.1
Using activejob 7.1.2
Using railties 7.1.2
Using sprockets-rails 3.4.2
Using rspec-rails 6.1.0
Using activerecord 7.1.2
Using tailwindcss-rails 2.0.32 (arm64-darwin)
Using turbo-rails 1.5.0
Using web-console 4.2.1
Using activestorage 7.1.2
Using jbuilder 2.11.5
Using actionmailer 7.1.2
Using actiontext 7.1.2
Using responders 3.1.1
Using importmap-rails 1.2.3
Using actionmailbox 7.1.2
Using stimulus-rails 1.3.0
Using rails 7.1.2
Using devise 4.9.3
Installing sassc 2.4.0 with native extensions
Gem::Ext::BuildError: ERROR: Failed to build gem
native extension.
current directory:
/Users/polo/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/sassc-2.4.0/ext
/Users/polo/.rbenv/versions/3.1.2/bin/ruby
-I
/Users/polo/.rbenv/versions/3.1.2/lib/ruby/3.1.0
-r ./siteconf20231122-26775-5x7we.rb extconf.rb
creating Makefile
current directory:
/Users/polo/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/sassc-2.4.0/ext
make DESTDIR\= clean
xcrun: error: invalid active developer path
(/Library/Developer/CommandLineTools), missing
xcrun at:
/Library/Developer/CommandLineTools/usr/bin/xcrun
current directory:
/Users/polo/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/sassc-2.4.0/ext
make DESTDIR\=
xcrun: error: invalid active developer path
(/Library/Developer/CommandLineTools), missing
xcrun at:
/Library/Developer/CommandLineTools/usr/bin/xcrun
make failed, exit code 1
Gem files will remain installed in
/Users/polo/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/sassc-2.4.0
for inspection.
Results logged to
/Users/polo/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/extensions/arm64-darwin-20/3.1.0/sassc-2.4.0/gem_make.out
/Users/polo/.rbenv/versions/3.1.2/lib/ruby/3.1.0/rubygems/ext/builder.rb:95:in
`run'
/Users/polo/.rbenv/versions/3.1.2/lib/ruby/3.1.0/rubygems/ext/builder.rb:44:in
`block in make'
/Users/polo/.rbenv/versions/3.1.2/lib/ruby/3.1.0/rubygems/ext/builder.rb:36:in
`each'
/Users/polo/.rbenv/versions/3.1.2/lib/ruby/3.1.0/rubygems/ext/builder.rb:36:in
`make'
/Users/polo/.rbenv/versions/3.1.2/lib/ruby/3.1.0/rubygems/ext/ext_conf_builder.rb:63:in
`block in build'
/Users/polo/.rbenv/versions/3.1.2/lib/ruby/3.1.0/tempfile.rb:317:in
`open'
/Users/polo/.rbenv/versions/3.1.2/lib/ruby/3.1.0/rubygems/ext/ext_conf_builder.rb:26:in
`build'
/Users/polo/.rbenv/versions/3.1.2/lib/ruby/3.1.0/rubygems/ext/builder.rb:161:in
`build_extension'
/Users/polo/.rbenv/versions/3.1.2/lib/ruby/3.1.0/rubygems/ext/builder.rb:195:in
`block in build_extensions'
/Users/polo/.rbenv/versions/3.1.2/lib/ruby/3.1.0/rubygems/ext/builder.rb:192:in
`each'
/Users/polo/.rbenv/versions/3.1.2/lib/ruby/3.1.0/rubygems/ext/builder.rb:192:in
`build_extensions'
/Users/polo/.rbenv/versions/3.1.2/lib/ruby/3.1.0/rubygems/installer.rb:853:in
`build_extensions'
/Users/polo/.rbenv/versions/3.1.2/lib/ruby/3.1.0/bundler/rubygems_gem_installer.rb:71:in
`build_extensions'
/Users/polo/.rbenv/versions/3.1.2/lib/ruby/3.1.0/bundler/rubygems_gem_installer.rb:28:in
`install'
/Users/polo/.rbenv/versions/3.1.2/lib/ruby/3.1.0/bundler/source/rubygems.rb:204:in
`install'
/Users/polo/.rbenv/versions/3.1.2/lib/ruby/3.1.0/bundler/installer/gem_installer.rb:54:in
`install'
/Users/polo/.rbenv/versions/3.1.2/lib/ruby/3.1.0/bundler/installer/gem_installer.rb:16:in
`install_from_spec'
/Users/polo/.rbenv/versions/3.1.2/lib/ruby/3.1.0/bundler/installer/parallel_installer.rb:186:in
`do_install'
/Users/polo/.rbenv/versions/3.1.2/lib/ruby/3.1.0/bundler/installer/parallel_installer.rb:177:in
`block in worker_pool'
/Users/polo/.rbenv/versions/3.1.2/lib/ruby/3.1.0/bundler/worker.rb:62:in
`apply_func'
/Users/polo/.rbenv/versions/3.1.2/lib/ruby/3.1.0/bundler/worker.rb:57:in
`block in process_queue'
/Users/polo/.rbenv/versions/3.1.2/lib/ruby/3.1.0/bundler/worker.rb:54:in
`loop'
/Users/polo/.rbenv/versions/3.1.2/lib/ruby/3.1.0/bundler/worker.rb:54:in
`process_queue'
/Users/polo/.rbenv/versions/3.1.2/lib/ruby/3.1.0/bundler/worker.rb:91:in
`block (2 levels) in create_threads'
An error occurred while installing sassc
(2.4.0), and Bundler cannot continue.

在 Gemfile 中: sassc-rails 已解析为 2.1.2,这取决于 在 萨斯克


这是我的本地主机中的消息:3000

HomeController#index 中的加载错误 无法加载此类文件——sassc 提取的源代码(第 10 行附近): 8 9 10 11 12 13

<%= stylesheet_link_tag "tailwind", "inter-font", "data-turbo-track": "reload" %>

<%= stylesheet_link_tag "application", "data-turbo-track": "reload" %>
<%= favicon_link_tag asset_path("airbnb-favicon.png")%>

Rails.root:/Users/polo/code/airbnb-clone

应用追踪 |框架跟踪 |完整追踪 应用程序/视图/布局/application.html.erb:10


我已经尝试过:

  • 宝石“sassc”
  • 降级rails版本
  • 捆绑安装 gem 本身
  • 询问我在 Youtube 上关注的人
  • 在我的manifest.js 文件中添加 //= 链接 tailwind.css
ruby-on-rails rubygems sassc
1个回答
0
投票

所以,这都是关于 xcode 的。

在终端中运行此命令:

$ xcode-select --install

还有塔达姆!

© www.soinside.com 2019 - 2024. All rights reserved.