【问题标题】:Giving error on rails bundle install在 rails bundle install 上出现错误
【发布时间】:2018-07-11 22:55:33
【问题描述】:

安装 json (1.8.6) 时出错,Bundler 无法继续。 在捆绑之前确保gem install json -v '1.8.6' 成功。

在 Gemfile 中:

rails 被解析为 4.2.6,这取决于

actionmailer was resolved to 4.2.6, which depends on
  actionpack was resolved to 4.2.6, which depends on
    actionview was resolved to 4.2.6, which depends on
      rails-dom-testing was resolved to 1.0.9, which depends on
        rails-deprecated_sanitizer was resolved to 1.0.3, which depends on
          activesupport was resolved to 4.2.6, which depends on
            json

Gem::Ext::BuildError: ERROR: 未能构建 gem 原生扩展。

current directory: /tmp/bundler20180201-46774-s2jlm4json-1.8.6/gems/json-1.8.6/ext/json/ext/generator
/usr/bin/ruby2.3 -r ./siteconf20180201-46774-16pojxx.rb extconf.rb
mkmf.rb can't find header files for ruby at /usr/lib/ruby/include/ruby.h

这是什么意思以及如何纠正它。我已经尝试过更新和升级方法,有没有其他方法可以删除某些依赖项。

【问题讨论】:

  • 尝试运行“bundle update”看看能否解决问题。
  • @zee 返回与捆绑安装相同的错误
  • 你运行的是什么操作系统。
  • 这里已经回答了同样的问题:stackoverflow.com/questions/4304438/…
  • 运行 ubuntu 17.04。运行 sudo apt-get install ruby​​2.3-dev 时出现错误。以下软件包具有未满足的依赖关系:ruby2.3-dev:依赖:libgmp-dev,但不会安装 E:无法纠正问题,您持有损坏的软件包。

标签: ruby-on-rails json ruby


【解决方案1】:

如有必要,请尝试更新源列表,否则请删除最近安装的大部分文件,然后从头开始进行全新安装。 如果需要,请单独安装每个持有的软件包

sudo apt-get uprade 

也可以。

【讨论】:

    【解决方案2】:

    试试这个:

    bundle update
    

    如果出现打包错误

    gem install bundler  #After that run below command too.
    
    bundle install
    

    【讨论】:

      猜你喜欢
      • 2016-06-01
      • 2021-11-30
      • 2015-11-27
      • 1970-01-01
      • 2013-12-24
      • 1970-01-01
      • 2012-02-20
      • 2013-01-05
      • 2019-06-07
      相关资源
      最近更新 更多