首页 > 系统相关 >在Windows系统中自动安装Ruby环境的批处理

在Windows系统中自动安装Ruby环境的批处理

时间:2022-11-24 17:34:18浏览次数:40  
标签:exe goto errorlevel Windows echo 批处理 Ruby wait

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
@echo This batch will install Ruby 3.1.2 almost automatically.
ruby.exe -v
@if errorlevel 1 goto :skip
@echo Ruby had installed.
@echo If the version of Ruby is lower than 3.1, please uninstall the old Ruby.
@echo Then you can run this batch to install 3.1.2.
@goto :wait
:skip
chdir %HOMEDRIVE%%HOMEPATH%
curl.exe -o install_ruby.exe https://s3.jcloud.sjtu.edu.cn/899a892efef34b1b944a19981040f55b-oss01/github-release/oneclick/rubyinstaller2/releases/download/RubyInstaller-3.1.2-1/rubyinstaller-devkit-3.1.2-1-x64.exe
@if errorlevel 1 goto :error1
install_ruby.exe /verysilent /dir=C:\Ruby /tasks="modpath,assocfiles,ridkinstall,defaultutf8"
@if errorlevel 1 goto :error2
if not exist C:\Ru mkdir C:\Ru
@if errorlevel 1 goto :error3
setx.exe RUBYLIB C:\Ru
@if errorlevel 1 goto :error4
setx.exe PATH "%PATH%;C:\Ru"
@if errorlevel 1 goto :error4
@goto :wait
:error1
@echo Download Ruby install package fail.
@goto :wait
:error2
@echo Run Ruby install package fail.
@goto :wait
:error3
@echo Make Ruby library directory fail.
@goto :wait
:error4
@echo Set user environment variable fail.
@goto :wait
:wait
@pause

标签:exe,goto,errorlevel,Windows,echo,批处理,Ruby,wait
From: https://www.cnblogs.com/fitmap/p/16922599.html

相关文章

  • Windows下如何开启openssh
    不经意间发现win10自带了openssh工具,相比较其他的ssh工具我觉得更加方便,开启方法如下:1、打开设置--应用 2、选择可选功能  3、点击添加功能  4、搜索框直......
  • centos双系统恢复windows启动项
    在网上教程​​http://www.centoscn.com/image-text/setup/2014/0728/3365.html​​的指引下在win10的系统下安装完centos7之后,莫名其妙原来Windows的启动引导消失了......
  • 初学银河麒麟linux笔记 第五章 windows中开发的QT程序适配linux的修改——外部控件重
    本人在WINDOWS系统中使用了“飞扬青云”的控件https://gitee.com/feiyangqingyun/QUCSDK由于系统移植,调用库应改为linux系统,首先下载对应版本的库,我windows上使用的是QT.......
  • Windows系统运行selenium
    1、系统已安装python;2、安装pip官网下载pip安装包:https://pypi.org/project/pip/#files  解压后  pythonsetup.pyinstall来安装pip  安装成功后将pip添......
  • 拉取所有分支的批处理
    理论上是直接gitclone就可以获取所有,但是我公司项目却不是这样的,我也很郁闷了。#!/bin/shmain(){REMOTES="$@";echo$REMOTES;if[-z"$REMOTES"];thenREMOT......
  • 工作时如何高效地无缝同时使用windows和ubuntu linux进行工作?
    背景:近期需要使用ubuntulinux编译调试工程代码,但是又需要记录调试过程及原理公式以及使用到一些只有windows平台的软件。然后就出现了两台电脑来回切换的问题。对于两台电......
  • Windows开机用户已被删除还是提示登录已删除用户
    这种情况,我这边是加域后出现这个问题。1.需要退出域控。2.修改注册表 3.重新加域恢复正常。或者管理直接修改域用户的注册表信息(未测试过不知道有没有效) ......
  • Windows Server 2012 R2 搭建IIS FTP 服务器
    这篇文章着重给大家讲解如何利用WindowsServer2012R2搭建本地IISFTP服务器环境:虚拟机:VMwareWindowsServer2012R2创建新首页删除默认文档......
  • Windows11右键改Win10
    Win11改Win10右键模式1.以管理员身份运行CMD控制台2.在控制台中输入下列代码后回车执行regadd"HKCU\Software\Classes\CLSID\{86ca1aa0-34aa-4e8b-a509-50c905bae2......
  • Windows设置一键安装Mysql数据库的方法
    Windows设置一键安装Mysql数据库的方法前言因为MySQL数据库的812665536以及3072最大索引长度等问题研发这边提交的补丁总是出现稀奇古怪的问题.mysql数据库又因为DB......