Warning: file_get_contents(/data/phpspider/zhask/data//catemap/5/ruby/20.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Ruby 在windows上安装gem http_解析器_Ruby_Makefile_Rubygems_Bootstrap 4 - Fatal编程技术网

Ruby 在windows上安装gem http_解析器

Ruby 在windows上安装gem http_解析器,ruby,makefile,rubygems,bootstrap-4,Ruby,Makefile,Rubygems,Bootstrap 4,我正在处理项目Symfony和bootstrap4,我想使用源代码Bootstrap。为此,我需要ruby和所有包 我启动了这个命令:bundler安装,在http_parser.rb(0.6.0)上安装时出错 我启动这个命令:gem install http_parser.rb——source'http://rubygems.org/'--install dir'/dev/tmp/http' 但是我有一个错误:C:/dev/Ruby24-x64/lib/ruby/gems/2.4.0/gems

我正在处理项目Symfony和bootstrap4,我想使用源代码Bootstrap。为此,我需要ruby和所有包

我启动了这个命令
bundler安装
,在http_parser.rb(0.6.0)上安装时出错

我启动这个命令:
gem install http_parser.rb——source'http://rubygems.org/'--install dir'/dev/tmp/http'

但是我有一个错误:
C:/dev/Ruby24-x64/lib/ruby/gems/2.4.0/gems/make-0.3.1/bin/make:4:in
”:未定义的局部变量或方法
make',用于main:Object(NameError)
来自C:/dev/Ruby24-x64/bin/make:22:in
load' 来自C:/dev/Ruby24-x64/bin/make:22:in

因此,我安装了make工具,使用了
gem安装make
已成功安装make-0.3.1
make-0.3.1的解析文档
0秒后完成make的文档安装
已安装1个gem

然后我尝试用安装http_解析器:
gem install http_parser.rb——source'http://rubygems.org/'--install dir'/dev/tmp/http'

但一切都没有改变。我再次指出了这个错误:
C:/dev/Ruby24-x64/lib/ruby/gems/2.4.0/gems/make-0.3.1/bin/make:4:in``':未定义的局部变量或main:Object的方法`make'(NameError)
从C:/dev/Ruby24-x64/bin/make:22:“加载”中
来自C:/dev/Ruby24-x64/bin/make:22:in`

如何在windows操作系统上安装http_解析器gem


为什么make不能正确运行但安装正确?

错误表明Ruby需要编译本机(非Ruby)代码才能安装和使用http\U解析器gem


要在Windows上编译本机代码,您需要使用DevKit包安装Ruby。如果使用RubyInstaller,只需选择Ruby+DevKit包,而不是普通的Ruby包。这将允许http_解析器安装完成。

您是否使用DevKit包安装了Ruby?如果没有,请重新安装并重试。要添加到@Casper的评论,这里有一个链接,其中包含安装DevKit的说明:已安装的最新版本Ruby DevKit 2.5解决了我的问题。警告:Ruby devKit 2.4不运行@Casper发布回复解决方案,我对此进行了检查。警告:对Ruby DevKit的版本要非常小心。谢谢您的回复@Casper