0

我在我的应用程序中为 s3 使用了雾宝石。捆绑器不会继续使用雾宝石。每当我尝试使用雾 gem 捆绑安装时,捆绑器都会出错。但是当我注释掉雾宝石时,它捆绑得很好。

重击:

bundle install

bash 输出:

    Fetching unf_ext 0.0.7.5
Installing unf_ext 0.0.7.5 with native extensions
Gem::Ext::BuildError: ERROR: Failed to build gem native extension.

    current directory: /home/abhijith/.rvm/gems/ruby-2.4.2/gems/unf_ext-0.0.7.5/ext/unf_ext
/home/abhijith/.rvm/rubies/ruby-2.4.2/bin/ruby -r ./siteconf20180522-15800-1awocpw.rb extconf.rb
checking for -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=/home/abhijith/.rvm/rubies/ruby-2.4.2/bin/$(RUBY_BASE_NAME)
    --with-static-libstdc++
    --without-static-libstdc++
    --with-stdc++lib
    --without-stdc++lib
/home/abhijith/.rvm/rubies/ruby-2.4.2/lib/ruby/2.4.0/mkmf.rb:457:in `try_do': The compiler failed to generate an executable file.
(RuntimeError)
You have to install development tools first.
    from /home/abhijith/.rvm/rubies/ruby-2.4.2/lib/ruby/2.4.0/mkmf.rb:542:in `try_link0'
    from /home/abhijith/.rvm/rubies/ruby-2.4.2/lib/ruby/2.4.0/mkmf.rb:557:in `try_link'
    from /home/abhijith/.rvm/rubies/ruby-2.4.2/lib/ruby/2.4.0/mkmf.rb:775:in `try_func'
    from /home/abhijith/.rvm/rubies/ruby-2.4.2/lib/ruby/2.4.0/mkmf.rb:1002:in `block in have_library'
    from /home/abhijith/.rvm/rubies/ruby-2.4.2/lib/ruby/2.4.0/mkmf.rb:945:in `block in checking_for'
    from /home/abhijith/.rvm/rubies/ruby-2.4.2/lib/ruby/2.4.0/mkmf.rb:351:in `block (2 levels) in postpone'
    from /home/abhijith/.rvm/rubies/ruby-2.4.2/lib/ruby/2.4.0/mkmf.rb:321:in `open'
    from /home/abhijith/.rvm/rubies/ruby-2.4.2/lib/ruby/2.4.0/mkmf.rb:351:in `block in postpone'
    from /home/abhijith/.rvm/rubies/ruby-2.4.2/lib/ruby/2.4.0/mkmf.rb:321:in `open'
    from /home/abhijith/.rvm/rubies/ruby-2.4.2/lib/ruby/2.4.0/mkmf.rb:347:in `postpone'
    from /home/abhijith/.rvm/rubies/ruby-2.4.2/lib/ruby/2.4.0/mkmf.rb:944:in `checking_for'
    from /home/abhijith/.rvm/rubies/ruby-2.4.2/lib/ruby/2.4.0/mkmf.rb:997: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:

  /home/abhijith/.rvm/gems/ruby-2.4.2/extensions/x86_64-linux/2.4.0/unf_ext-0.0.7.5/mkmf.log

extconf failed, exit code 1

Gem files will remain installed in /home/abhijith/.rvm/gems/ruby-2.4.2/gems/unf_ext-0.0.7.5 for inspection.
Results logged to /home/abhijith/.rvm/gems/ruby-2.4.2/extensions/x86_64-linux/2.4.0/unf_ext-0.0.7.5/gem_make.out

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

In Gemfile:
  fog was resolved to 2.0.0, which depends on
    fog-ovirt was resolved to 1.0.3, which depends on
      rbovirt was resolved to 0.1.5, which depends on
        rest-client was resolved to 2.0.2, which depends on
          http-cookie was resolved to 1.0.3, which depends on
            domain_name was resolved to 0.5.20180417, which depends on
              unf was resolved to 0.1.4, which depends on
                unf_ext

此 gem install 安装在 Ubuntu 16.x 上,但不安装在我的 Ubuntu 18.x 上。

提前致谢 !

4

2 回答 2

0

我有同样的问题,然后我gem 'fog-aws'在 Gemfile 中这样使用

gem 'fog-aws'
gem 'fog'

然后bundle install解决了我的问题。

我想会帮助你。

于 2018-05-22T10:42:04.607 回答
0

在这种情况下,您将只使用 S3,而不是

gem 'fog'

改为使用

gem 'fog-aws'

在您的 gem 文件中,它应该可以工作。

于 2018-09-04T10:23:49.483 回答