简体   繁体   English

是否可以在Mac Os 10.7.5上安装ruby 2.3.4?

[英]Is it possible to install ruby 2.3.4 on Mac Os 10.7.5?

I would like to upgrade to Rails 5.1 我想升级到Rails 5.1

I am using an old mac computer with OS 10.7.5 and, on my understanding, I can not upgrade the operating system to a newer version. 我正在使用OS 10.7.5的旧Mac计算机,根据我的理解,我无法将操作系统升级到更新版本。 If there is a way, please let me know. 如果有办法,请告诉我。 I am developing on this computer using Rails 4.2.6. 我正在使用Rails 4.2.6在这台计算机上进行开发。 I want to upgrade to Rails 5.1 but, it will need Ruby >= 2.2.2. 我想升级到Rails 5.1但是,它需要Ruby> = 2.2.2。 My ruby 2.1.1 is the better I can get, according to rbenv install --list . 根据rbenv install --list ,我的ruby 2.1.1越好。 I tried reinstalling rbenv and ruby-build and upgrading them but, the rbenv install --list doesn't upgrade to the newest versions of ruby. 我尝试重新安装rbenv和ruby-build并升级它们但是, rbenv install --list没有升级到最新版本的ruby。

To give you heads up, .rbenv/plugins does not exist in my computer. 为了让您高兴,我的电脑中不存在.rbenv/plugins

I read and tried all the suggestions I found on stackoverflow.com and google similar to my case but, none of them worked for me. 我阅读并尝试了我在stackoverflow.com和google上发现的所有建议,类似于我的案例但是,这些建议都不适合我。

Any suggestion will be welcome. 任何建议都将受到欢迎。

Thanks in advance, 提前致谢,

if your mac can use 10.7.5 you can upgrade your mac to version 10.11 (I'm using it so I can answer it) my opinion your for your ruby version is deal with homebrew you can upgrade your homebrew and then from homebrew you upgrade rbenv and so on. 如果您的Mac可以使用10.7.5,您可以将您的Mac升级到10.11版本(我正在使用它以便我可以回答它)我认为您的ruby版本是处理自制软件您可以升级您的自制程序然后从自制程序升级rbenv等。

Below is some step by step to install rails with RBENV, probably you can follow along, what command that probably you missed 下面是一步一步用RBENV安装rails,可能你可以跟着,可能你错过了什么命令

  1. rbenv versions rbenv版本

    • check your rbenv version 检查你的rbenv版本
    • if you think you need to upgrade you can use command below 如果您认为需要升级,可以使用以下命令
    • brew upgrade rbenv ruby-build brew升级rbenv ruby​​-build
  2. rbenv install -l rbenv install -l

    • check list of ruby that can be installed with rbenv 检查可以用rbenv安装的ruby列表
  3. rbenv install 2.3.1 rbenv安装2.3.1

    • this is sample to install ruby version 2.3.1 这是安装ruby版本2.3.1的示例
    • ruby will be copied to /Users/%your_user_name%/.rbenv/versions/2.3.1 ruby将被复制到/Users/%your_user_name%/.rbenv/versions/2.3.1
    • this is just sample version, use the latest / stable from command number 2 这只是示例版本,使用命令编号2中的最新/稳定版
  4. rbenv global 2.3.1 rbenv global 2.3.1

    • set global ruby to version 2.3.1 将global ruby​​设置为2.3.1版
  5. rbenv local 2.1.1 rbenv local 2.1.1

    • after you set global (with version 2.3.1) in case you want specific folder with version 2.1.1 you can set local folder with this command, so the new ruby Don't messed up your old project 设置全局(版本2.3.1)后,如果你想要2.1.1版本的特定文件夹,你可以用这个命令设置本地文件夹,所以新的ruby不要弄乱你的旧项目
  6. rbenv rehash rbenv rehash

    • this command will apply new ruby version that you just install 此命令将应用您刚刚安装的新ruby版本

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

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