fromStep3above.rubydk.rbinittogenerat" />

亚洲免费在线-亚洲免费在线播放-亚洲免费在线观看-亚洲免费在线观看视频-亚洲免费在线看-亚洲免费在线视频

如何確認Devkit是否安裝成功

系統 1985 0

昨天在安裝了Ruby 1.9.2 ,并且將其路徑加入到 Devkit config.yml 中,并且使用 ruby dk.rb install 安裝(不幸的是,沒注意安裝信息)。。但是依然無法構建native gem。于是重裝Ruby,按照devkit的安裝說明來安裝。還是不正確。 Devkit的安裝說明的第4步為Run Installation Scripts:

  • cd <DEVKIT_INSTALL_DIR> from Step 3 above.
  • ruby dk.rb init to generate the config.yml file to be used later in this Step. Your installed Rubies will be listed there (only those installed by a RubyInstaller package are detected at present).
  • edit the generated config.yml file to include installed Rubies not automagically discovered or remove Rubies you do not want to use the DevKit with.
  • [optional] ruby dk.rb review to review the list of Rubies to be enhanced to use the DevKit and verify the changes you made to it are correct.
  • finally, ruby dk.rb install to DevKit enhance your installed Rubies. This step installs (or updates) an operating_system.rb file into the relevant directory needed to implement a RubyGems pre_install hook and a devkit.rb helper library file into <RUBY_INSTALL_DIR>\lib\ruby\site_ruby . NOTE: you may need to use the --force option to update (with backup of the originals) the above mentioned files as discussed at the SFX DevKit upgrade FAQ entry.

在最后一步可知,安裝Devkit其實就是更新了 operating_system.rb 文件,同時新建了 devkit.rb 文件。 在我的電腦上 devkit.rb 已經創建好(Devkit安裝在 D:/Ruby187/devkit 目錄下, 其他電腦上的路徑可能與我的不同 ):

  1. # enable RubyInstaller DevKit usage as a vendorable helper library ?
  2. unless ENV[ 'PATH' ].include?( 'd:\\Ruby187\\devkit\\mingw\\bin' ) then ?
  3. ? puts 'Temporarily enhancing PATH to include DevKit...' ?
  4. ? ENV[ 'PATH' ] = 'd:\\Ruby187\\devkit\\bin;d:\\Ruby187\\devkit\\mingw\\bin;' + ENV[ 'PATH' ]?
  5. end ?
    # enable RubyInstaller DevKit usage as a vendorable helper library

unless ENV['PATH'].include?('d:\\Ruby187\\devkit\\mingw\\bin') then

  puts 'Temporarily enhancing PATH to include DevKit...'

  ENV['PATH'] = 'd:\\Ruby187\\devkit\\bin;d:\\Ruby187\\devkit\\mingw\\bin;' + ENV['PATH']

end
  

在Ruby1.9.2中,有兩個 operating_system.rb 文件,分別位于 lib\ruby\site_ruby\1.9.1\rubygems\defaults lib\ruby\1.9.1\rubygems\defaults 下,其內容相同:

  1. # :DK-BEG: missing DevKit/build tool convenience notice ?
  2. ?
  3. Gem.pre_install do |gem_installer|?
  4. ? unless gem_installer.spec.extensions.empty??
  5. ??? have_tools = %w{gcc make sh}.all? do |t|?
  6. ????? system( "#{t} --version > NUL 2>&1" )?
  7. ??? end ?
  8. ?
  9. ??? unless have_tools?
  10. ????? raise Gem::InstallError,<<-EOT?
  11. The '#{gem_installer.spec.name}' native gem requires installed build tools.?
  12. ?
  13. Please update your PATH to include build tools or download the DevKit?
  14. from 'http://rubyinstaller.org/downloads' and follow the instructions?
  15. at 'http://github.com/oneclick/rubyinstaller/wiki/Development-Kit' ?
  16. EOT?
  17. ??? end ?
  18. ? end ?
  19. end ?
  20. # :DK-END: ?
    # :DK-BEG: missing DevKit/build tool convenience notice



Gem.pre_install do |gem_installer|

  unless gem_installer.spec.extensions.empty?

    have_tools = %w{gcc make sh}.all? do |t|

      system("#{t} --version > NUL 2>&1")

    end



    unless have_tools

      raise Gem::InstallError,<<-EOT

The '#{gem_installer.spec.name}' native gem requires installed build tools.



Please update your PATH to include build tools or download the DevKit

from 'http://rubyinstaller.org/downloads' and follow the instructions

at 'http://github.com/oneclick/rubyinstaller/wiki/Development-Kit'

EOT

    end

  end

end

# :DK-END:
  

參考了我電腦上其他版本的Ruby(1.8.7-p334和1.8.7-p330,分別都只有一個 operating_system.rb ),在安裝好Devkit之后,該文件應該為:

  1. Gem.pre_install do |i|?
  2. ? unless ENV[ 'PATH' ].include?( 'd:\\Ruby187\\devkit\\mingw\\bin' ) then ?
  3. ??? puts 'Temporarily enhancing PATH to include DevKit...' ?
  4. ??? ENV[ 'PATH' ] = 'd:\\Ruby187\\devkit\\bin;d:\\Ruby187\\devkit\\mingw\\bin;' + ENV[ 'PATH' ]?
  5. ? end ?
  6. end ?
    Gem.pre_install do |i|

  unless ENV['PATH'].include?('d:\\Ruby187\\devkit\\mingw\\bin') then

    puts 'Temporarily enhancing PATH to include DevKit...'

    ENV['PATH'] = 'd:\\Ruby187\\devkit\\bin;d:\\Ruby187\\devkit\\mingw\\bin;' + ENV['PATH']

  end

end
  

在修改了 lib\ruby\1.9.1\rubygems\defaults\operating_system.rb 之后,構建native gem時,依然找不到Devkit;但修改 lib\ruby\site_ruby\1.9.1\rubygems\defaults\operating_system.rb 后(不修改 lib\ruby\1.9.1\rubygems\defaults\operating_system.rb ),便可以成功構建。 所以, 如何確認Devkit是否安裝成功呢? 答:檢查 devkit.rb operating_system.rb 文件,其內容應該和上面的內容相同;否則,安裝不成功。 可以手動更改這兩個文件為上面的形式(好像也可以刪除這兩個文件,然后使用 ruby dk.rb install 命令,此時會創建 – 未驗證)。在使用 ruby dk.rb install 時候,需要注意安裝信息或警告,如果某些文件已經存在,可能會跳過。 但是, 為什么在看似“正常”的安裝步驟下,為什么沒能安裝好Devkit? 我沒有找到原因;或許我的某個步驟有問題。我發現,雖然我安裝的是1.9.2,但是卻被安裝在了 lib\ruby\1.9.1 目錄下, 官方解釋 說:

This version is a “library compatible version.” Ruby 1.9.2 is almost 1.9.1 compatible, so the library is installed in the 1.9.1 directory.

如何確認Devkit是否安裝成功


更多文章、技術交流、商務合作、聯系博主

微信掃碼或搜索:z360901061

微信掃一掃加我為好友

QQ號聯系: 360901061

您的支持是博主寫作最大的動力,如果您喜歡我的文章,感覺我的文章對您有幫助,請用微信掃描下面二維碼支持博主2元、5元、10元、20元等您想捐的金額吧,狠狠點擊下面給點支持吧,站長非常感激您!手機微信長按不能支付解決辦法:請將微信支付二維碼保存到相冊,切換到微信,然后點擊微信右上角掃一掃功能,選擇支付二維碼完成支付。

【本文對您有幫助就好】

您的支持是博主寫作最大的動力,如果您喜歡我的文章,感覺我的文章對您有幫助,請用微信掃描上面二維碼支持博主2元、5元、10元、自定義金額等您想捐的金額吧,站長會非常 感謝您的哦!!!

發表我的評論
最新評論 總共0條評論
主站蜘蛛池模板: 天天狠天天操 | 日韩欧美亚洲综合 | 亚洲精品国产一区二区图片欧美 | 黄色色片 | 九九黄色大片 | a在线视频免费观看 | 91欧美| 久草观看视频 | 午夜视频福利在线观看 | 久久久久久噜噜噜久久久精品 | 久久久在线视频精品免费观看 | 久久久精品免费视频 | 国产亚洲欧美久久久久 | 可以免费观看一级毛片黄a 可以直接看的毛片 | 亚洲你xx我xx网站 | 欧美伊人 | h片在线观看网站 | 亚洲狠狠操 | 国产乱子伦一区二区三区 | 日日做夜夜做 | 四虎影视国产精品 | 免费国产a | 色综合久久夜色精品国产 | 日本免费特黄aa毛片 | 国产xxx视频 | 国产一级αv片免费观看 | 亚洲综合图片人成综合网 | 我不卡老子影院午夜伦我不卡四虎 | 91高清在线成人免费观看 | 久久综合偷偷噜噜噜色 | 国产69精品久久久久99不卡 | 国产日韩中文字幕 | 五月婷婷狠狠 | 四虎永久在线精品免费观看地址 | 91视频播放 | 99热成人精品国产免男男 | 九九热视 | 四虎免费看 | 神马影院我不卡手机 | 华人亚洲欧美精品国产 | 欧美magnet|