简体   繁体   English

Bundle Install命令不会安装我的宝石?

[英]Bundle Install command won't install my gems?

Okay, so I'm very new to Rails, and am just beginning to feel my way around my new Linux operating system as well. 好的,所以我对Rails很陌生,并且刚刚开始尝试使用我的新Linux操作系统。

I'm currently doing a project for school, and I've followed all of the directions to perfection. 我正在为学校做一个项目,我已经完成了所有的指示。 For consistency purposes, they want specific versions of both rails and gemsets. 出于一致性目的,他们需要rails和gemsets的特定版本。

After I have initialized rails in my directory, I then run a bundle install command, and have several installation issues which I are in the code block as follows: 在我的目录中初始化了rails之后,我运行了一个bundle install命令,并且我在代码块中遇到了几个安装问题,如下所示:

user@user-ThinkPad-T430 ~/code/bloccit $ sudo bundle install
[sudo] password for user: 
Don't run Bundler as root. Bundler can ask for sudo if it is needed, 
and installing your bundle as root will break this application for all
non-root users on this machine.
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 12.3.0
Using concurrent-ruby 1.0.5
Installing json 1.8.6 with native extensions

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

current directory: /var/lib/gems/2.3.0/gems/json-
1.8.6/ext/json/ext/generator
/usr/bin/ruby2.3 -r ./siteconf20171128-11271-1ah858h.rb extconf.rb
mkmf.rb can't find header files for ruby at 
/usr/lib/ruby/include/ruby.h

extconf failed, exit code 1

Gem files will remain installed in /var/lib/gems/2.3.0/gems/json-1.8.6 
for inspection.
Results logged to /var/lib/gems/2.3.0/extensions/x86_64-
linux/2.3.0/json-1.8.6/gem_make.out
Using minitest 5.10.3
Using thread_safe 0.3.6
Using builder 3.2.3
Using erubis 2.7.0
Using mini_portile2 2.3.0
Using crass 1.0.3
Using rack 1.6.8
Using mini_mime 1.0.0
Using arel 6.0.4
Using bundler 1.11.2
Using coffee-script-source 1.12.2
Using execjs 2.7.0
Using thor 0.20.0
Installing ffi 1.9.18 with native extensions

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

current directory: /var/lib/gems/2.3.0/gems/ffi-1.9.18/ext/ffi_c
/usr/bin/ruby2.3 -r ./siteconf20171128-11271-1382ks7.rb extconf.rb
mkmf.rb can't find header files for ruby at 
/usr/lib/ruby/include/ruby.h

extconf failed, exit code 1

Gem files will remain installed in /var/lib/gems/2.3.0/gems/ffi-1.9.18 
for inspection.
Results logged to /var/lib/gems/2.3.0/extensions/x86_64-
linux/2.3.0/ffi-1.9.18/gem_make.out
Installing pg 0.21.0 with native extensions

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

current directory: /var/lib/gems/2.3.0/gems/pg-0.21.0/ext
/usr/bin/ruby2.3 -r ./siteconf20171128-11271-171n79p.rb extconf.rb
mkmf.rb can't find header files for ruby at 
/usr/lib/ruby/include/ruby.h

extconf failed, exit code 1

Gem files will remain installed in /var/lib/gems/2.3.0/gems/pg-0.21.0 
for inspection.
Results logged to /var/lib/gems/2.3.0/extensions/x86_64-
linux/2.3.0/pg-0.21.0/gem_make.out
Using rb-fsevent 0.10.2
Using tilt 2.0.8
Installing sqlite3 1.3.13 with native extensions

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

current directory: /var/lib/gems/2.3.0/gems/sqlite3-1.3.13/ext/sqlite3
/usr/bin/ruby2.3 -r ./siteconf20171128-11271-ml1ggl.rb extconf.rb
mkmf.rb can't find header files for ruby at 
/usr/lib/ruby/include/ruby.h

extconf failed, exit code 1

Gem files will remain installed in /var/lib/gems/2.3.0/gems/sqlite3-
1.3.13 for inspection.
Results logged to /var/lib/gems/2.3.0/extensions/x86_64-
linux/2.3.0/sqlite3-1.3.13/gem_make.out
Using turbolinks-source 5.0.3
Using i18n 0.9.1
An error occurred while installing json (1.8.6), and Bundler cannot 
continue.
Make sure that `gem install json -v '1.8.6'` succeeds before bundling.

The main error seems to be the Gem::Ext::BuildError: ERROR: Failed to build gem native extension. 主要错误似乎是Gem::Ext::BuildError: ERROR: Failed to build gem native extension. line, but it's also having problems installing json within the bundler. 但是它在捆绑器中安装json时也遇到了问题。

Any helpful advice or tips would be appreciated! 任何有用的建议或提示将不胜感激!

First of all follow the instruction (please avoid sudo ): 首先按照说明(请避免sudo ):

Don't run Bundler as root. 不要以root身份运行Bundler。 Bundler can ask for sudo if it is needed, and installing your bundle as root will break this application for all non-root users on this machine. 如果需要,Bundler可以请求sudo,并且以root身份安装捆绑包将破坏此计算机上所有非root用户的应用程序。

To resolve this issue in linux , run: 要在linux解决此问题,请运行:

sudo apt install ruby2.3-dev

Cheers! 干杯!

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM