简体   繁体   English

如何在 termux 上安装特定版本的 ruby​​-dev

[英]How to install a specific version of ruby-dev on termux

I'm trying to setup ruby on rails environment on termux on android.我正在尝试在 android 上的 termux 上设置 ruby​​ on rails 环境。 I want to use 2.1.10 ruby .我想使用2.1.10 ruby All I found was apt install ruby-dev or pkg install ruby-dev which installs the latest version of ruby.我发现的只是apt install ruby-devpkg install ruby-dev ,它安装了最新版本的 ruby​​。 any suggestions?有什么建议?

You can install rvm.你可以安装rvm。
0. Recomendation: install tmux and zsh , and change zsh as default shell. 0. 建议:安装tmuxzsh ,并将 zsh 更改为默认 shell。 Oh my Zsh worked.哦,我的 Zsh工作了。 Powerline fonts too (by install termux-style script)电力线字体(通过安装 termux 风格的脚本)

Let's install rvm:让我们安装 rvm:
1. Install gawk, curl and tar packages: 1. 安装 gawk、curl 和 tar 包:
apt install curl gawk tar
2. Go to rvm.io site and just copy 'Install RVM' command, look' like: 2. 转到 rvm.io 站点,然后复制“安装 RVM”命令,如下所示:
curl -sSL https://get.rvm.io | bash -s stable
3. Add this line [[ -s "$HOME/.rvm/scripts/rvm" ]] && . "$HOME/.rvm/scripts/rvm" 3. 添加这一行[[ -s "$HOME/.rvm/scripts/rvm" ]] && . "$HOME/.rvm/scripts/rvm" [[ -s "$HOME/.rvm/scripts/rvm" ]] && . "$HOME/.rvm/scripts/rvm" to your ~/.bashrc or ~/.zshrc file [[ -s "$HOME/.rvm/scripts/rvm" ]] && . "$HOME/.rvm/scripts/rvm"到你的 ~/.bashrc 或 ~/.zshrc 文件
4. Now your shell must writing a syntax PS problem, just open rvm script and edit it: 4.现在你的shell肯定是写了一个语法PS问题,直接打开rvm脚本编辑一下:
vi ~/.rvm/scripts/rvm
Now you must found a block like:现在你必须找到一个像这样的块:

 case "`uname` in
(CYGWIN*|MINGW*)
... etc ... 

Just replace the 3 initialization variable __shell_name strings with this:只需将 3 个初始化变量 __shell_name 字符串替换为:

__shell_name="gawk 'BEGIN{RS=\"\"}; NR==1{print; exit
}' /proc/$$/cmdline | tr - '\0'" ;;
  1. Restart shell重启外壳
  2. Now you can install ruby from rvm.现在您可以从 rvm 安装 ruby​​。 Usage at rvm.io rvm.io 上的用法
    Ps: jruby not supported while you don't found solution for install jdk and jre from Termux). Ps:不支持 jruby,而您没有找到从 Termux 安装 jdk 和 jre 的解决方案)。
    Ps: sorry for bad English. Ps:抱歉英语不好。

apt install ruby-dev installs ruby 2.5.1-1 apt install ruby-dev安装 ruby​​ 2.5.1-1

And that's the latest version, I think.这是最新版本,我想。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM