Devkitが正常にインストールされているかどうかを確認する方法
7241 ワード
昨日Ruby 1.9.2がインストールされ、そのパスがDevkitの edit the generated [optional] finally,
最後のステップでは、Devkitをインストールすることは、
view plain
copy to clipboard
print
?
# 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
Ruby 1.9.2には2つの
view plain
copy to clipboard
print
?
# :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-p 334と1.8.7-p 330は、それぞれ
view plain
copy to clipboard
print
?
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
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.
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). config.yml
file to include installed Rubies not automagically discovered or remove Rubies you do not want to use the DevKit with. 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. 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
ディレクトリにインストールされています.他のパソコンのパスは私とは異なるかもしれません):view plain
copy to clipboard
?
# enable RubyInstaller DevKit usage as a vendorable helper library
puts 'Temporarily enhancing PATH to include DevKit...'
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
Ruby 1.9.2には2つの
operating_system.rb
ファイルがあり、それぞれlib\ruby\site_ruby\1.9.1\rubygems\defaults
とlib\ruby\1.9.1\rubygems\defaults
の下にあり、その内容は同じである.view plain
copy to clipboard
?
# :DK-BEG: missing DevKit/build tool convenience notice
Gem.pre_install do |gem_installer|
have_tools = %w{gcc make sh}.all? do |t|
end
unless have_tools
The '#{gem_installer.spec.name}' native gem requires installed build tools.
Please update your PATH to include build tools or download the DevKit
at 'http://github.com/oneclick/rubyinstaller/wiki/Development-Kit'
end
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-p 334と1.8.7-p 330は、それぞれ
operating_system.rb
が1つしかありません)を参考にして、Devkitをインストールした後、このファイルは次のようになります.view plain
copy to clipboard
?
Gem.pre_install do |i|
puts 'Temporarily enhancing PATH to include DevKit...'
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
のファイルを検査して、その内容は上の内容と同じであるべきです;そうでなければ、インストールは成功しません.この2つのファイルは、上記の形式で手動で変更できます(2つのファイルを削除して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.