Ask Your Question
0

How to create a batch file to create environment variable path for Ruby installation?

asked 2014-10-27 23:24:09 -0500

Imdad KP gravatar image

updated 2014-10-30 01:28:20 -0500

class ruby::bundler inherits ruby::params {
 $setx1 = "C:\\tmp\\rubyinstaller-${ruby_version}.exe /silent"
 $setx2 = 'setx PATH "%PATH%;C:\Ruby193\bin"'

if $::osfamily != 'windows' {
  exec { "${module_name} - gem install":
  command      => "gem install bundler -v ${bundler_version}",
  path         => [ '/usr/bin', '/bin' ],
  environment  => [ "HTTP_PROXY=${http_proxy}" ],
  unless       => 'which bundle',
  require      => Class['repos::proxy'],

} } else {

exec { "download ruby":
  cwd         => 'C:/tmp',
  command     => "${cmdwget} '${repository_url}/ruby/rubyinstaller-${ruby_version}.exe'",
  creates     => "C:/tmp/rubyinstaller-${ruby_version}.exe",
  require     => File['C:/tmp'],

} exec { "rubyinstaller - install package": cwd => 'C:\tmp', command => "C:\tmp\rubyinstaller-${ruby_version}.exe /silent && setx PATH \"%PATH%;C:\Ruby193\bin;\"", #command => "${setx1} && ${setx2}", creates => "C:/Ruby193/unins000.exe", require => Exec ["download ruby"],

} } }

where I can add file type and, what will be the content, how to execute that???

edit retag flag offensive close merge delete

Comments

Could you edit your question? Please add 4 spaces to the beginning of each line in your code blocks. This will cause the blocks to be correctly treated as code, preserving newlines and other formatting. See here: http://daringfireball.net/projects/markdown/syntax#precode

cbarbour gravatar imagecbarbour ( 2014-10-29 23:51:15 -0500 )edit

Are you trying to create a permanent path entry, or a temporary path for a single operation?

cbarbour gravatar imagecbarbour ( 2014-10-30 12:56:45 -0500 )edit

permanent path entry.

Imdad KP gravatar imageImdad KP ( 2014-10-31 01:03:42 -0500 )edit

1 Answer

Sort by ยป oldest newest most voted
0

answered 2014-10-31 02:32:29 -0500

cbarbour gravatar image

I recommend you look at basti1302's excellent windows_path module. With this module, you can manipulate the system and user specific paths in a safe, idempotent way.

https://forge.puppetlabs.com/basti130...

edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower

Stats

Asked: 2014-10-27 23:24:09 -0500

Seen: 253 times

Last updated: Oct 31 '14