如何在Win7上调试Ruby程序

Python022

如何在Win7上调试Ruby程序,第1张

先安装rubyinstaller,下载并解压DevKit,注意,这两个版本要对应,网页上有说明(http://rubyinstaller.org/downloads/),解压DevKit后,打开目录,运行devkitvars.bat(是不是必须的不确定)。

打开cmd,进入DevKit的解压目录

ruby dk.rb

---

Configures an MSYS/MinGW based Development Kit (DevKit) for

each of the Ruby installations on your Windows system. The

DevKit enables you to build many of the available native

RubyGems that don't yet have a binary gem.

Usage: ruby dk.rb COMMAND [options]

where COMMAND is one of:

init prepare DevKit for installation

review review DevKit install plan

install install required DevKit executables

and 'install' [options] are:

-f, --force overwrite existing helper scripts

-------------

ruby dk.rb init

---

Initialization complete! Please review and modify the auto-generated

'config.yml' file to ensure it contains the root directories to all

of the installed Rubies you want enhanced by the DevKit.

--------------------------------

ruby dk.rb install

---

Invalid configuration or no Rubies listed. Please fix 'config.yml'

and rerun 'ruby dk.rb install'

如果出现的是这个,则需要修改config.yml

加入

- C:\Ruby200-x64

---

[INFO] Updating convenience notice gem override for 'C:/Ruby200-x64'

[INFO] Installing 'C:/Ruby200-x64/lib/ruby/site_ruby/devkit.rb'

这是对的

---------------------

gem install ruby-debug-ide

---

Temporarily enhancing PATH to include DevKit...

Building native extensions. This could take a while...

Successfully installed ruby-debug-ide-0.4.17

Parsing documentation for ruby-debug-ide-0.4.17

Installing ri documentation for ruby-debug-ide-0.4.17

1 gem installed

在TestRuby目录新建一个ruby的源码文件main.rb

在TestRuby目录新建gemfile

在gemfile输入以下内容

在TestRuby目录下创建.vscode目录,然后在 .vscode 里面再创建一个名字叫 launch.json 的文件,文件里面输入下面的内容。

pull request就是请求别人pull自己的仓库

当然,一般发起pull request的人都是从被请求人,那里clone的代码(github上则可以直接fork),一般比被请求人的项目提前若干commit。

pull request只是一种项目合作形式,github只是整合了相应功能,脱离github照样能pull request。

比如Linux内核项目,直接给linux发邮件,标题就是Pull Request。邮件里写上git的url和新增的feature或者修的bug。

如果linux觉得ok,就会根据给出的git url去git pull,github只是把上述过程集成在了站内,更加方便新人。

扩展资料:

github 合作开发模式主要有三种。

一、Fork 方式。

开发者 fork 自己生成一个独立的分支,跟主分支完全独立,pull代码后,项目维护者可根据代码质量决定是否merge代码。

二、组织。

组织的所有者可以针对不同的代码仓库建立不同访问权限的团队。

新建一个组织,然后添加项目成员,根据提示设置完毕,在仓库的Collaborators 下面的Teams就可以添加或者remove组织成员

三、合作者。

代码仓库的所有者可以为单个仓库增加具备只读或者读写权限的协作者。

合作者方式比较实用,也很方便,新建一个Repository,完毕之后,进入Repository的Settings,然后在Manage Collaborators里就可以管理合作者了。

参考资料来源:百度百科——github