mirror of
https://github.com/elastic/logstash.git
synced 2025-04-24 14:47:19 -04:00
Run the installer from ruby instead of using system(); otherwise we risk running the wrong ruby
This commit is contained in:
parent
3142af0c19
commit
a3b8d6db43
1 changed files with 16 additions and 7 deletions
23
gembag.rb
23
gembag.rb
|
@ -1,6 +1,7 @@
|
|||
#!/usr/bin/env ruby
|
||||
|
||||
require "rubygems/package"
|
||||
require "rubygems/specification"
|
||||
require "rubygems/commands/install_command"
|
||||
|
||||
gemspec = ARGV.shift
|
||||
|
||||
|
@ -11,13 +12,21 @@ deps = [spec.development_dependencies, spec.runtime_dependencies].flatten
|
|||
target = "vendor/bundle/jruby/1.9/"
|
||||
|
||||
deps.each do |dep|
|
||||
cmd = "gem install --install-dir #{target} #{dep.name} -v '#{dep.requirement}'"
|
||||
puts cmd
|
||||
system(cmd)
|
||||
#cmd = "gem install --install-dir #{target} #{dep.name} -v '#{dep.requirement}'"
|
||||
installer = Gem::Commands::InstallCommand.new
|
||||
installer.options[:generate_rdoc] = false
|
||||
installer.options[:generate_ri] = false
|
||||
installer.options[:version] = dep.requirement
|
||||
installer.options[:args] = [dep.name]
|
||||
begin
|
||||
installer.execute
|
||||
rescue Gem::SystemExitException => e
|
||||
if e.exit_code != 0
|
||||
puts "Installation of #{dep.to_s} failed"
|
||||
raise
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
#specs_and_sources, errors = Gem::SpecFetcher.fetcher.fetch_with_errors(deps.first, true, true, false)
|
||||
#require "pry"; binding.pry
|
||||
|
||||
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue