ruby / ruby/snap.ruby

Can't install gem json v 1.8.6

未关闭
#14 9 条评论 4 个 reaction 已指派 0 人 在 GitHub 查看

还没有人认领这个 Issue。

主要语言
HTML
星标
32
派生
5
平均合并
14 小时 17 分钟
30 天内合并 PR
1

描述

I have to work on an old rails 4.2 codebase. I have installed Ruby 2.3 as a snap package - I am trying to avoid rvm.
Now, when I run bundle install it complains that it can't install the json gem. Here is the error message:

Gem::Ext::BuildError: ERROR: Failed to build gem native extension.

current directory: /home/user/.gem/gems/json-1.8.6/ext/json/ext/generator
//bin/ruby -r ./siteconf20190430-29073-znwkkd.rb extconf.rb
sh: 1: //bin/ruby: not found

extconf failed, exit code 127

When I try to install just the gem with 'gem install json -v '1.8.6' --source 'https://rubygems.org/'' I get this error:

ERROR: Error installing json:
ERROR: Failed to build gem native extension.

current directory: /home/user/.gem/gems/json-1.8.6/ext/json/ext/generator
/snap/bin/ruby -r ./siteconf20190430-30141-z86zxd.rb extconf.rb
mkmf.rb can't find header files for ruby at /snap/ruby/109/lib/ruby/include/ruby.h

extconf failed, exit code 1

So, as far as I can tell the native extension is looking in the wrong directory for the ruby headers - I guess...

贡献指南

这个仓库没有索引到贡献指南

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

调研方向

首先使用 Ruby snap 软件包重现报告的 bundle installgem install json -v '1.8.6' 失败。比较 /snap/bin/ruby//bin/ruby 路径,以及缺失的 /snap/ruby/109/lib/ruby/include/ruby.h 头文件;对于此设置,json gem 成功安装即表示完成。

由索引模型根据 Issue 内容生成。

评估

技术栈
ruby
领域
build-system
Issue 类型
缺陷
难度
4/5
预计耗时
3-5 天
活跃度
停滞
描述清晰度
需要澄清
新手友好度
25/100

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。