如何在Windows上安装ruby的'byebug'? [英] How do I install 'byebug' for ruby on Windows?

查看:184
本文介绍了如何在Windows上安装ruby的'byebug'?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我是ruby的新手,尝试设置我的开发环境(Windows 10)。我安装了ruby和rails,但无法安装。从我阅读的内容开始,我首先需要DevKit。所以我按照这里的指南安装了它:



https://github.com/oneclick/rubyinstaller/wiki/Development-Kit



然后尝试安装该宝石,但没有运气。
我试图卸载,然后强制安装DevKit,但仍不能通过安装。
这就是我所看到的:

  C:\RubySDK> gem install byebug 
临时增强包括DevKit的路径...
构建本机扩展。这可能需要一段时间...
错误:安装byebug时出错:
错误:无法构建gem本机扩展。

C:/Ruby22/bin/ruby.exe -r ./siteconf20150923-3628-5vg5h3.rb extconf.rb
创建Makefile

makeDESTDIR = clean

makeDESTDIR =
生成byebug-i386-mingw32.def
编译breakpoint.c
从c:/ Ruby22 / include / ruby-2.2.0 / ruby​​.h:33:0,来自./byebug.h:4的
,来自breakpoint.c的
:1:
c:/ Ruby22 / include / ruby​​- 2.2.0 / ruby​​ / ruby​​.h:111:14:error:array'ruby_check_sizeof_voidp'的大小为负值
在c:/Ruby22/include/ruby-2.2.0/ruby.h中包含的文件中:33 :0,来自./byebug.h:4的
,来自breakpoint.c的
:1:
c:/Ruby22/include/ruby-2.2.0/ruby/ruby.h:In函数'rb_obj_freeze_inline':
c:/Ruby22/include/ruby-2.2.0/ruby/ruby.h:1156:9:错误:从不同大小的整数转换为指针[-Werror = int-to-pointer -cast]
c:/Ruby22/include/ruby-2.2.0/ruby/ruby.h:1157:2:错误:从不同大小的整数转换为指针[-Werro r = int-to-pointer-cast]
c:/Ruby22/include/ruby-2.2.0/ruby/ruby.h:1158:6:错误:从不同大小的整数转换为指针[-Werror = int-to-pointer-cast]
c:/Ruby22/include/ruby-2.2.0/ruby/ruby.h:1158:27:错误:从不同大小的整数转换为指针[-Werror = int- to-pointer-cast]
c:/Ruby22/include/ruby-2.2.0/ruby/ruby.h:函数'rb_data_object_get':
c:/Ruby22/include/ruby-2.2.0/ ruby / ruby​​.h:1192:13:错误:从不同大小的整数转换为指针[-Werror = int-to-pointer-cast]
c:/Ruby22/include/ruby-2.2.0/ruby/ ruby.h:在函数'rb_obj_written'中:
c:/Ruby22/include/ruby-2.2.0/ruby/ruby.h:1271:10:错误:从不同大小的整数转换为指针[-Werror = int-to-pointer-cast]
c:/Ruby22/include/ruby-2.2.0/ruby/ruby.h:1271:34:错误:从不同大小的整数转换为指针[-Werror = int- to-pointer-cast]
c:/Ruby22/include/ruby-2.2.0/ruby/ruby.h:函数'rb_num2char_inline':
c:/Ruby22/include/ruby-2.2。 0 / ruby​​ / ruby​​.h:1344:9:错误:从不同大小的整数转换为指针[-Werror = int-to-pointer-cast]
c:/Ruby22/include/ruby-2.2.0/ ruby / ruby​​.h:1344:9:错误:从不同大小的整数转换为指针[-Werror = int-to-pointer-cast]
c:/Ruby22/include/ruby-2.2.0/ruby/ ruby.h:1344:9:错误:从不同大小的整数转换为指针[-Werror = int-to-pointer-cast]
c:/Ruby22/include/ruby-2.2.0/ruby/ruby。 h:1344:36:错误:从不同大小的整数转换为指针[-Werror = int-to-pointer-cast]
c:/Ruby22/include/ruby-2.2.0/ruby/ruby.h: 1344:36:错误:从不同大小的整数转换为指针[-Werror = int-to-pointer-cast]
c:/Ruby22/include/ruby-2.2.0/ruby/ruby.h:1344: 36:错误:从不同大小的整数转换为指针[-Werror = int-to-pointer-cast]
c:/Ruby22/include/ruby-2.2.0/ruby/ruby.h:1345:9:错误:从不同大小的整数转换为指针[-Werror = int-to-pointer-cast]
c:/Ruby22/include/ruby-2.2.0/ruby/ruby.h:1345:9:error: CA st指向不同大小的整数的指针[-Werror = int-to-pointer-cast]
c:/Ruby22/include/ruby-2.2.0/ruby/ruby.h:1345:9:error:cast to来自不同大小整数的指针[-Werror = int-to-pointer-cast]
c:/Ruby22/include/ruby-2.2.0/ruby/ruby.h:函数'rb_class_of':
c :/Ruby22/include/ruby-2.2.0/ruby/ruby.h:1670:12:错误:从不同大小的整数转换为指针[-Werror = int-to-pointer-cast]
c:/在函数'rb_type'中:
c:/Ruby22/include/ruby-2.2.0/ruby/ruby.h:1687:12:error:Ruby22 / include / ruby​​-2.2.0 / ruby​​ / ruby​​.h:转换为不同大小的整数指针[-Werror = int-to-pointer-cast]
breakpoint.c:在函数'eval_expression'中:
breakpoint.c:21:45:error:cast to从不同大小的整数指针[-Werror = int-to-pointer-cast]
breakpoint.c:21:45:错误:从不同大小的整数转换为指针[-Werror = int-to-pointer-转换]
breakpoint.c:21:45:错误:从不同大小的整数转换为指针[-Werr或= int-to-pointer-cast]
breakpoint.c:函数'filename_cmp_impl':
breakpoint.c:288:11:错误:从不同大小的整数转换为指针[-Werror = int-to-pointer-cast]
breakpoint.c:288:11:error:从不同大小的整数转换为指针[-Werror = int-to-pointer-cast]
breakpoint.c: 288:11:错误:从不同大小的整数转换为指针[-Werror = int-to-pointer-cast]
breakpoint.c:292:16: Werror = int-to-pointer-cast]
breakpoint.c:292:16:error:从不同大小的整数转换为指针[-Werror = int-to-pointer-cast]
断点。 c:292:16:错误:从不同大小的整型转换为指针[-Werror = int-to-pointer-cast]
breakpoint.c:函数'find_breakpoint_by_pos':
breakpoint.c: 458:10:错误:从不同大小的整数转换为指针[-Werror = int-to-pointer-cast]
breakpoint.c:458:10: Werror = int-to-pointer-cast]
breakpoint.c:458:10:error:从不同大小的整数转换为指针[-Werror = int-to-pointer-cast]
breakpoint.c: 460:19:错误:从不同大小的整数转换为指针[-Werror = int-to-pointer-cast]
breakpoint.c:460:19: Werror = int-to-pointer-cast]
breakpoint.c:460:19:错误:从不同大小的整数转换为指针[-Werror = int-to-pointer-cast]
断点。 c:在函数'find_breakpoint_by_method'中:
breakpoint.c:480:19:错误:从不同大小的整型转换为指针[-Werror = int-to-pointer-cast]
breakpoint.c: 480:19:错误:从不同大小的整数转换为指针[-Werror = int-to-pointer-cast]
breakpoint.c:480:19: Werror = int-to-pointer-cast]
cc1.exe:将所有警告视为错误
make:*** [breakpoint.o]错误1

失败,退出代码2

Gem文件将继续安装在C:/Ruby22/lib/ruby/gems/2.2.0/gems/byebug-6.0.2中进行检查。
记录到C的结果:/Ruby22/lib/ruby/gems/2.2.0/extensions/x86-mingw32/2.2.0/byebug-6.0.2/gem_make.out

是否有其他解决方法?
谢谢

解决方案

我知道这是一个迟到的回复!



但是,如果您在使用DevKit时遇到困难,例如buybug或json等原生gem,则必须知道如果您的系统类型为64位你必须使用一个RubyInstaller 64位和DevKit 64位。按照32位系统类型的原则,使用RubyInstaller 32位和DevKit 32位

另外不要忘记在安装后运行几个命令,ruby和rails以及DevKit,通过终端(cmd在windows中)永久安装DevKit并运行:



命令:


  1. ruby​​ dk.rb init - 这将创建配置文件
    <然后运行 ruby​​ dk.rb install

干杯和快乐编码。
Ibrax。


I am new to ruby and trying to setup my dev environment (Windows 10). I have installed ruby and rails but cannot install byebug. From what I read I need the DevKit first. So I installed it by following the guide here:

https://github.com/oneclick/rubyinstaller/wiki/Development-Kit

and then tried to install the gem but have no luck. I have tried to uninstall and then force install DevKit but still cant get byebug installed. This is what I am seeing:

C:\RubySDK>gem install byebug
Temporarily enhancing PATH to include DevKit...
Building native extensions.  This could take a while...
ERROR:  Error installing byebug:
        ERROR: Failed to build gem native extension.

    C:/Ruby22/bin/ruby.exe -r ./siteconf20150923-3628-5vg5h3.rb extconf.rb
creating Makefile

make "DESTDIR=" clean

make "DESTDIR="
generating byebug-i386-mingw32.def
compiling breakpoint.c
In file included from c:/Ruby22/include/ruby-2.2.0/ruby.h:33:0,
                 from ./byebug.h:4,
                 from breakpoint.c:1:
c:/Ruby22/include/ruby-2.2.0/ruby/ruby.h:111:14: error: size of array 'ruby_check_sizeof_voidp' is negative
In file included from c:/Ruby22/include/ruby-2.2.0/ruby.h:33:0,
                 from ./byebug.h:4,
                 from breakpoint.c:1:
c:/Ruby22/include/ruby-2.2.0/ruby/ruby.h: In function 'rb_obj_freeze_inline':
c:/Ruby22/include/ruby-2.2.0/ruby/ruby.h:1156:9: error: cast to pointer from integer of different size [-Werror=int-to-pointer-cast]
c:/Ruby22/include/ruby-2.2.0/ruby/ruby.h:1157:2: error: cast to pointer from integer of different size [-Werror=int-to-pointer-cast]
c:/Ruby22/include/ruby-2.2.0/ruby/ruby.h:1158:6: error: cast to pointer from integer of different size [-Werror=int-to-pointer-cast]
c:/Ruby22/include/ruby-2.2.0/ruby/ruby.h:1158:27: error: cast to pointer from integer of different size [-Werror=int-to-pointer-cast]
c:/Ruby22/include/ruby-2.2.0/ruby/ruby.h: In function 'rb_data_object_get':
c:/Ruby22/include/ruby-2.2.0/ruby/ruby.h:1192:13: error: cast to pointer from integer of different size [-Werror=int-to-pointer-cast]
c:/Ruby22/include/ruby-2.2.0/ruby/ruby.h: In function 'rb_obj_written':
c:/Ruby22/include/ruby-2.2.0/ruby/ruby.h:1271:10: error: cast to pointer from integer of different size [-Werror=int-to-pointer-cast]
c:/Ruby22/include/ruby-2.2.0/ruby/ruby.h:1271:34: error: cast to pointer from integer of different size [-Werror=int-to-pointer-cast]
c:/Ruby22/include/ruby-2.2.0/ruby/ruby.h: In function 'rb_num2char_inline':
c:/Ruby22/include/ruby-2.2.0/ruby/ruby.h:1344:9: error: cast to pointer from integer of different size [-Werror=int-to-pointer-cast]
c:/Ruby22/include/ruby-2.2.0/ruby/ruby.h:1344:9: error: cast to pointer from integer of different size [-Werror=int-to-pointer-cast]
c:/Ruby22/include/ruby-2.2.0/ruby/ruby.h:1344:9: error: cast to pointer from integer of different size [-Werror=int-to-pointer-cast]
c:/Ruby22/include/ruby-2.2.0/ruby/ruby.h:1344:36: error: cast to pointer from integer of different size [-Werror=int-to-pointer-cast]
c:/Ruby22/include/ruby-2.2.0/ruby/ruby.h:1344:36: error: cast to pointer from integer of different size [-Werror=int-to-pointer-cast]
c:/Ruby22/include/ruby-2.2.0/ruby/ruby.h:1344:36: error: cast to pointer from integer of different size [-Werror=int-to-pointer-cast]
c:/Ruby22/include/ruby-2.2.0/ruby/ruby.h:1345:9: error: cast to pointer from integer of different size [-Werror=int-to-pointer-cast]
c:/Ruby22/include/ruby-2.2.0/ruby/ruby.h:1345:9: error: cast to pointer from integer of different size [-Werror=int-to-pointer-cast]
c:/Ruby22/include/ruby-2.2.0/ruby/ruby.h:1345:9: error: cast to pointer from integer of different size [-Werror=int-to-pointer-cast]
c:/Ruby22/include/ruby-2.2.0/ruby/ruby.h: In function 'rb_class_of':
c:/Ruby22/include/ruby-2.2.0/ruby/ruby.h:1670:12: error: cast to pointer from integer of different size [-Werror=int-to-pointer-cast]
c:/Ruby22/include/ruby-2.2.0/ruby/ruby.h: In function 'rb_type':
c:/Ruby22/include/ruby-2.2.0/ruby/ruby.h:1687:12: error: cast to pointer from integer of different size [-Werror=int-to-pointer-cast]
breakpoint.c: In function 'eval_expression':
breakpoint.c:21:45: error: cast to pointer from integer of different size [-Werror=int-to-pointer-cast]
breakpoint.c:21:45: error: cast to pointer from integer of different size [-Werror=int-to-pointer-cast]
breakpoint.c:21:45: error: cast to pointer from integer of different size [-Werror=int-to-pointer-cast]
breakpoint.c: In function 'filename_cmp_impl':
breakpoint.c:288:11: error: cast to pointer from integer of different size [-Werror=int-to-pointer-cast]
breakpoint.c:288:11: error: cast to pointer from integer of different size [-Werror=int-to-pointer-cast]
breakpoint.c:288:11: error: cast to pointer from integer of different size [-Werror=int-to-pointer-cast]
breakpoint.c:292:16: error: cast to pointer from integer of different size [-Werror=int-to-pointer-cast]
breakpoint.c:292:16: error: cast to pointer from integer of different size [-Werror=int-to-pointer-cast]
breakpoint.c:292:16: error: cast to pointer from integer of different size [-Werror=int-to-pointer-cast]
breakpoint.c: In function 'find_breakpoint_by_pos':
breakpoint.c:458:10: error: cast to pointer from integer of different size [-Werror=int-to-pointer-cast]
breakpoint.c:458:10: error: cast to pointer from integer of different size [-Werror=int-to-pointer-cast]
breakpoint.c:458:10: error: cast to pointer from integer of different size [-Werror=int-to-pointer-cast]
breakpoint.c:460:19: error: cast to pointer from integer of different size [-Werror=int-to-pointer-cast]
breakpoint.c:460:19: error: cast to pointer from integer of different size [-Werror=int-to-pointer-cast]
breakpoint.c:460:19: error: cast to pointer from integer of different size [-Werror=int-to-pointer-cast]
breakpoint.c: In function 'find_breakpoint_by_method':
breakpoint.c:480:19: error: cast to pointer from integer of different size [-Werror=int-to-pointer-cast]
breakpoint.c:480:19: error: cast to pointer from integer of different size [-Werror=int-to-pointer-cast]
breakpoint.c:480:19: error: cast to pointer from integer of different size [-Werror=int-to-pointer-cast]
cc1.exe: all warnings being treated as errors
make: *** [breakpoint.o] Error 1

make failed, exit code 2

Gem files will remain installed in C:/Ruby22/lib/ruby/gems/2.2.0/gems/byebug-6.0.2 for inspection.
Results logged to C:/Ruby22/lib/ruby/gems/2.2.0/extensions/x86-mingw32/2.2.0/byebug-6.0.2/gem_make.out

Is there another way around this? Thanks

解决方案

I know this is a late reply!

But when you face difficulties with DevKit, in this case with native gem such as buybug or json, you have to know that if your System type is 64 bit, you must use a RubyInstaller 64 bit, and DevKit 64 bit. Follow the same principle with a 32 bit system type, use a RubyInstaller 32bit, and DevKit 32bit.

Also do not forget to run few commands after you installed, ruby and rails and DevKit, to do this go to the permanent installation of DevKit through terminal(cmd in windows) and run:

Commands:

  1. ruby dk.rb init - this will create the configuration file
  2. then run ruby dk.rb install

Cheers and Happy Coding. Ibrax.

这篇关于如何在Windows上安装ruby的'byebug'?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆