簡體   English   中英

無法在我的rails應用程序中安裝霧寶石

[英]Cannot install fog gem in my rails aplication

我在應用程序中使用了霧寶石作為s3。 捆綁器沒有繼續使用霧寶石。 每當我嘗試將安裝包與fog 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安裝程序安裝在Ubuntu 16.x上,而不安裝在我的Ubuntu 18.x上。

提前致謝 !

我遇到了同樣的問題,然后我在Gemfile中使用了像這樣的gem'fog gem 'fog-aws'

gem 'fog-aws'
gem 'fog'

然后bundle install它解決了我的問題。

我想會幫你的。

在這種情況下,您將只使用S3,而不是

gem 'fog'

改用

gem 'fog-aws'

在您的gem文件中,它應該可以工作。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM