How to check whether devkit is successfully installed

Source: Internet
Author: User

Yesterday I installed Ruby 1.9.2 and added the path to the devkitConfig. ymlAnd useRuby DK. RB installInstall (unfortunately, do not pay attention to the installation information ).. But still cannot build native gem. Therefore, reinstall Ruby and install it according to the devkit installation instructions. Still incorrect. Step 1 of devkit installation instructions is run installation scripts:

  • CD <devkit_install_dir>From step 3 above.
  • Ruby DK. RB initTo generateConfig. ymlFile 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 generatedConfig. ymlFile to include installed rubies not automagically discovered or remove rubies you do not want to use the devkit.
  • [Optional] Ruby DK. RB ReviewTo 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 installTo devkit enhance your installed rubies. This step instils (or updates)Operating_system.rbFile into the relevant directory needed to implement a rubygemsPre_installHook andDevkit. RbHelper library file<Ruby_install_dir> \ Lib \ Ruby \ site_ruby.Note:You may need to use-- ForceOption to update (with backup of the originals) the above mentioned files as discussed at the SFX devkit upgrade FAQ entry.

The last step shows that installing devkit is actually an update.Operating_system.rbFile, and a newDevkit. RbFile. On my computerDevkit. RbCreated (devkit installed onD:/ruby187/devkitDirectory,The path on other computers may be different from mine.):

View plaincopy to clipboardprint?
    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' ] / span>
    5. end
# Enable rubyinstaller devkit usage as a vendorable helper libraryunless 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

In ruby1.9.2, there are twoOperating_system.rbFile, located inLib \ Ruby \ site_ruby \ 1.9.1 \ rubygems \ defaultsAndLib \ Ruby \ 1.9.1 \ rubygems \ defaultsThe content is the same:

View plaincopy to clipboardprint?
  1. #: DK-BEG: Missing devkit/build tool convenience notice
  2. Gem. pre_installDo| Gem_installer |
  3. UnlessGem_installer.spec.extensions.empty?
  4. Have_tools = % W {GCC make sh}. All?Do| T |
  5. System ("# {T} -- version> NUL 2> & 1")
  6. End
  7. UnlessHave_tools
  8. RaiseGEM: installerror, <-EOT
  9. The'# {Gem_installer.spec.name }'Native gem requires installed build tools.
  10. Please update your path to include build toolsOrDownload the devkit
  11. From'Http: // rubyinstaller.org/downloads'AndFollow the instructions
  12. At'Http: // github.com/oneclick/rubyinstaller/wiki/development-kit'
  13. EOT
  14. End
  15. End
  16. End
  17. #: DK-END:
 
#: DK-BEG: Missing devkit/build tool convenience noticegem. 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, <-eotthe '# {gem_installer.spec.name} 'native gem requires installed build tools. please update your path to include build tools or download the devkitfrom 'HTTP: // rubyinstaller.org/downloads' and follow the instructionsat 'HTTP: // your end endend #: DK-END:

Refer to other Ruby versions on my computer (1.8.7-p334 and 1.8.7-P330, each of which has only oneOperating_system.rbAfter devkit is installed, the file should be:

View plaincopy to clipboardprint?
  1. Gem. pre_installDo| I |
  2. UnlessEnv ['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'] endend

After modificationLib \ Ruby \ 1.9.1 \ rubygems \ defaults \ operating_system.rbAfter that, devkit is still not found when building native gem;Lib \ Ruby \ site_ruby \ 1.9.1 \ rubygems \ defaults \ operating_system.rbAfter (not modifiedLib \ Ruby \ 1.9.1 \ rubygems \ defaults \ operating_system.rb. So,How can I check whether devkit is successfully installed? Answer: CheckDevkit. RbAndOperating_system.rbFile, the content should be the same as the above content; otherwise, the installation fails.You can manually change these two files to the above format (it seems you can also delete these two files, and then useRuby DK. RB installCommand, which is created at this time-not verified ). In useRuby DK. RB installYou must pay attention to the installation information or warning. If some files already exist, they may be skipped. However,Why didn't devkit be installed properly under the seemingly "normal" Installation Steps?I did not find the cause; maybe there is a problem with one of my steps. I found that although I installed 1.9.2, it was installed inLib \ Ruby \ 1.9.1The official explanation is as follows:

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.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.