ruby-on-rails 无法捆绑安装gem“sasssc-rails”

q5iwbnjs  于 4个月前  发布在  Ruby
关注(0)|答案(1)|浏览(70)

这是我的第一个问题,请原谅我没有很好地解释。
我想在我的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,它依赖于sassc

我本地主机的消息:3000

LoadError in HomeController#index cannot load such file -- 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/波罗/code/airbnb-clone
应用程序跟踪|框架跟踪|完整跟踪app/views/layouts/application.html.erb:10
我试过了:

  • gem“sassc”
  • 降级rails版本
  • 捆绑安装gem本身
  • 去问我在Youtube上关注的人
  • 在manifest.js文件中添加//= link tailwind.css
disho6za

disho6za1#

这一切都是关于xcode的。
在终端中运行此命令:
$ xcode-select --install
还有塔达姆!

相关问题