安装unf_ext(0.0.7.2)时出错,bundler无法继续

fcg9iug3  于 2022-10-15  发布在  Ruby
关注(0)|答案(4)|浏览(129)

我试着把散居者安装到本地主机上。我删除了Gemfile.lock文件并尝试了bundle install,现在看到了这个。
这些都是我已经尝试过的东西

  • ARCHFLAGS=-Wno-error=unused-command-line-argument-hard-error-in-future gem install unf_ext
  • xcode-select --install
  • sudo xcodebuild -license
Krishnas-MacBook-Air:diaspora KrishnaTeja$ bundle install
Fetching gem metadata from https://rails-assets.org/....
Fetching version metadata from https://rails-assets.org/..
Fetching dependency metadata from https://rails-assets.org/..
Fetching gem metadata from https://rubygems.org/.......
Fetching version metadata from https://rubygems.org/..
Fetching dependency metadata from https://rubygems.org/.
Resolving dependencies..............................
Using rake 11.3.0
Using CFPropertyList 2.3.4
Using i18n 0.7.0
Using json 1.8.3
Using minitest 5.10.1
Using thread_safe 0.3.5
Using builder 3.2.2
Using erubis 2.7.0
Using mini_portile2 2.1.0
Using rack 1.6.5
Using mime-types-data 3.2016.0521
Using arel 6.0.3
Using addressable 2.4.0
Using excon 0.54.0
Using formatador 0.2.5
Using multi_json 1.12.1
Using ipaddress 0.8.3
Using xml-simple 1.1.5
Using inflecto 0.0.2
Using trollop 2.1.2
Your user account isn't allowed to install to the system Rubygems.
You can cancel this installation and run:

  bundle install --path vendor/bundle

to install the gems into ./vendor/bundle/, or you can enter your  password

and install the bundled gems to Rubygems using sudo.
Password: 
Installing unf_ext 0.0.7.2 with native extensions
Using ast 2.3.0
Using attr_required 1.0.1
Using execjs 2.7.0
Using coffee-script-source 1.11.1
Using eco-source 1.1.0.rc.1
Using ejs 1.1.1
Using thor 0.19.4
Installing bcrypt 3.1.11 with native extensions
Using bindata 2.3.4
Using sass 3.4.22
Using bootstrap-switch-rails 3.3.3
Using buftok 0.2.0
Using bundler 1.13.6
Installing byebug 9.0.6 with native extensions
Using mimemagic 0.3.2
Installing hitimes 1.2.4 with native extensions
Installing nio4r 1.2.1 with native extensions
Using chunky_png 1.3.8
Using cliver 0.3.2
Using coderay 1.1.1
Using rb-fsevent 0.9.7
Using ffi 1.9.14
Using hike 1.2.3
Using tilt 1.4.1
Using concurrent-ruby 1.0.2
Using configurate 0.3.1
Using connection_pool 2.2.1
Using docile 1.1.5
Using simplecov-html 0.10.0
Using tins 1.13.0
Using safe_yaml 1.0.4
Using gherkin 4.0.0
Using cucumber-wire 0.0.1
Using diff-lcs 1.2.5
Using multi_test 0.1.2
Using rspec-support 3.5.0
Using database_cleaner 1.5.3
Using orm_adapter 0.5.0
Using diaspora-prosody-config 0.0.7
Using multipart-post 2.0.0
Using valid 1.2.0
Using equalizer 0.0.10
Installing sigar 0.7.3 with native extensions
Using state_machine 1.2.0
Using ruby-progressbar 1.8.1
Using get_process_mem 0.2.1
Using multi_xml 0.5.5
Using unicode-display_width 1.1.1
Using request_store 1.3.1
Using ruby_dep 1.5.0
Using lumberjack 1.0.10
Using nenv 0.3.0
Using shellany 0.0.1
Using method_source 0.8.2
Using slop 3.6.0
Using guard-compat 1.2.1
Using powerpack 0.1.1
Using rainbow 2.1.0
Using sysexits 1.2.0
Using temple 0.7.7
Using hashdiff 0.3.1
Using hashie 3.4.6
Using http-form_data 1.0.1
Installing http_parser.rb 0.6.0 with native extensions
Using http_accept_language 2.0.5
Using httpclient 2.8.2.4
Using jasmine-core 2.5.2
Using phantomjs 2.1.1.0
Using jasmine-jquery-rails 2.0.3
Using securecompare 1.0.0
Using url_safe_base64 0.2.2
Using jwt 1.5.6
Installing kgio 2.10.0 with native extensions
Using leaflet-rails 0.7.7
Using little-plugger 1.1.4
Using systemu 2.6.5
Using markerb 1.1.0
Using mini_magick 4.5.1
Using naught 1.1.0
Using nested_form 0.3.2
Using oauth 0.5.1
Using websocket-extensions 0.1.2
Installing rugged 0.24.0 with native extensions
Using rack-cors 0.4.0
Using rack-piwik 0.3.0
Using rack-rewrite 1.5.1
Using rails-assets-autosize 3.0.17
Using rails-assets-blueimp-gallery 2.21.3
Using rails-assets-jquery 2.2.4
Using rails-assets-emojione 2.0.1
Using rails-assets-favico.js 0.3.10
Using rails-assets-jquery-fullscreen-plugin 0.5.0
Using rails-assets-jquery.slimscroll 1.3.8
Using rails-assets-highlightjs 9.7.0
Using rails-assets-jasmine 2.5.2
Using rails-assets-markdown-it 8.0.0
Using rails-assets-markdown-it--markdown-it-for-inline 0.1.1
Using rails-assets-markdown-it-diaspora-mention 1.0.0
Using rails-assets-markdown-it-hashtag 0.4.0
Using rails-assets-markdown-it-sanitizer 0.4.3
Using rails-assets-markdown-it-sub 1.0.0
Using rails-assets-markdown-it-sup 1.0.0
Using rails-assets-perfect-scrollbar 0.6.12
Using remotipart 1.3.1
Installing raindrops 0.17.0 with native extensions
Installing redcarpet 3.3.4 with native extensions
Using redis 3.3.2
Using ruby-oembed 0.10.1
Using rubyzip 1.2.0
Using useragent 0.16.8
Using simple_oauth 0.3.1
Using yard 0.9.5
Using timecop 0.8.1
Using turbo_dev_assets 0.0.2
Using will_paginate 3.1.5
Using fission 0.5.0
Using i18n-inflector 2.6.7
Using tzinfo 1.2.2
Using memoizable 0.4.2
Installing nokogiri 1.6.8.1 with native extensions
Using rack-test 0.6.3
Using warden 1.2.6
Using rack-mobile-detect 0.4.0
Using rack-protection 1.5.3
Using rack-ssl 1.4.1
Using mime-types 3.1
Using json-schema 2.7.0
Using fog-core 1.43.0
Using jsonpath 0.5.8
Gem::Ext::BuildError: ERROR: Failed to build gem native extension.

current directory:       /private/var/folders/nb/j6bftgxj0bd7zq5g98hn3xnc0000gn/T/bundler20161204-90063-19uje57unf_ext-0.0.7.2/gems/unf_ext-0.0.7.2/ext/unf_ext
/Users/KrishnaTeja/.rbenv/versions/2.3.0/bin/ruby -r      ./siteconf20161204-90063-15sm4gh.rb extconf.rb
checking for main() in -lstdc++...***extconf.rb failed***
Could not create Makefile due to some reason, probably lack of  necessary
libraries and/or headers.  Check the mkmf.log file for more details.  You may
need configuration options.

Provided configuration options:
--with-opt-dir
--without-opt-dir
--with-opt-include
--without-opt-include=${opt-dir}/include
--with-opt-lib
--without-opt-lib=${opt-dir}/lib
--with-make-prog
--without-make-prog
--srcdir=.
--curdir
--ruby=/Users/KrishnaTeja/.rbenv/versions/2.3.0/bin/$(RUBY_BASE_NAME)
--with-static-libstdc++
--without-static-libstdc++
--with-stdc++lib
--without-stdc++lib

/Users /KrishnaTeja/.rbenv/versions/2.3.0/lib/ruby/2.3.0/mkmf.rb:456:in    `try_do': The compiler failed to generate an executable file.   (RuntimeError)
    You have to install development tools first.
    from 
    /Users /KrishnaTeja/.rbenv/versions/2.3.0/lib/ruby/2.3.0/mkmf.rb:541:in `try_link0'
    from 

    /Users /KrishnaTeja/.rbenv/versions/2.3.0/lib/ruby/2.3.0/mkmf.rb:556:in `try_link'
    from
    /Users /KrishnaTeja/.rbenv/versions/2.3.0/lib/ruby/2.3.0/mkmf.rb:765:in `try_func'
from /Users/KrishnaTeja/.rbenv/versions/2.3.0/lib/ruby/2.3.0/mkmf.rb:997:in `block in have_library'
from /Users/KrishnaTeja/.rbenv/versions/2.3.0/lib/ruby/2.3.0/mkmf.rb:942:in `block in checking_for'
from /Users/KrishnaTeja/.rbenv/versions/2.3.0/lib/ruby/2.3.0/mkmf.rb:350:in `block (2 levels) in postpone'
from /Users/KrishnaTeja/.rbenv/versions/2.3.0/lib/ruby/2.3.0/mkmf.rb:320:in `open'
from /Users/KrishnaTeja/.rbenv/versions/2.3.0/lib/ruby/2.3.0/mkmf.rb:350:in `block in postpone'
from /Users/KrishnaTeja/.rbenv/versions/2.3.0/lib/ruby/2.3.0/mkmf.rb:320:in `open'
from /Users/KrishnaTeja/.rbenv/versions/2.3.0/lib/ruby/2.3.0/mkmf.rb:346:in `postpone'
from /Users/KrishnaTeja/.rbenv/versions/2.3.0/lib/ruby/2.3.0/mkmf.rb:941:in `checking_for'
from /Users/KrishnaTeja/.rbenv/versions/2.3.0/lib/ruby/2.3.0/mkmf.rb:992:in `have_library'
from extconf.rb:6:in `<main>'

To see why this extension failed to compile, please check the mkmf.log which can be found here:

/var/folders/nb/j6bftgxj0bd7zq5g98hn3xnc0000gn/T/bundler20161204-90063-19uje57unf_ext-0.0.7.2/extensions/x86_64-darwin-15/2.3.0-static/unf_ext-0.0.7.2/mkmf.log

extconf failed, exit code 1

Gem files will remain installed in /var/folders/nb/j6bftgxj0bd7zq5g98hn3xnc0000gn/T/bundler20161204-90063-19uje57unf_ext-0.0.7.2/gems/unf_ext-0.0.7.2 for inspection.
Results logged to /var/folders/nb/j6bftgxj0bd7zq5g98hn3xnc0000gn/T/bundler20161204-90063-19uje57unf_ext-0.0.7.2/extensions/x86_64-darwin-15/2.3.0-static/unf_ext-0.0.7.2/gem_make.out

An error occurred while installing unf_ext (0.0.7.2), and Bundler cannot continue.
Make sure that `gem install unf_ext -v '0.0.7.2'` succeeds before bundling.

我看了看其他类似的问题,但都没有帮助。任何帮助都将不胜感激。先谢谢你。

e5njpo68

e5njpo681#

我重新安装了Xcode,删除了Gemlock文件,更新了捆绑包,最后安装了捆绑包……一切都很顺利,应用程序也很顺利。

eoigrqb6

eoigrqb62#

试试这个:)
sudo apt-get install ruby-dev和继续bundle install

nuypyhwy

nuypyhwy3#

对于那些在安装Fastlane时遇到这个An error occurred while installing unf_ext问题的人来说,如果你的Ruby版本太旧,这种情况经常会发生。MacOS中的默认Ruby版本为2.6.x,您需要至少2.7.x才能使其正常工作。在这种情况下,我建议安装Ruby版本管理器(https://rvm.io/)并将ruby "2.7.6"行添加到Gemfile中。然后,Ruby版本管理器将强制您在安装gem时使用此版本的ruby,这个问题应该会消失。

ru9i0ody

ru9i0ody4#

您可以尝试以下操作:

sudo apt-get install libgmp-dev

sudo apt-get install libgmp3-dev

相关问题