In this article I will explain how you can get RVM (Ruby Version Manager) installed on Ubuntu 12.04 Linux. First we have to make sure that we have some dependencies installed, so run the following command to take care of them.
sudo apt-get install build-essential git-core
Now we need to install RVM (Ruby Version Manager) using curl. If you do not have curl installed yet on your system, you can issue the following command
sudo apt-get install curl
To start the RVM installation run the following command
bash -s stable < <(curl -s https://raw.github.com/wayneeseguin/rvm/master/binscripts/rvm-installer)
Now we need to add a line to our bashrc file so run the following command
echo '[[ -s "/home/andre/.rvm/scripts/rvm" ]] && source "/home/andre/.rvm/scripts/rvm"' >> ~/.bashrc # or .zshrc
Make sure to replace andre with your user name in the above command so that you will not have any issues on your system. Now run
source ~/.bashrc # or .zshrc
To test if our installation of RVM was succesfull, we can run a command and check its output.
type rvm | head -1
If the output of the above command is equivalent to rvm is a function, then we now have a working RVM installation. Now our Ruby Version Manager is installed and we can go ahead and install all the Rubies we want. To extend this article a little more I will go over how to install an actual Ruby version and also a Ruby Gem. So here we go...
rvm install 1.9.3
The above command will install Ruby version 1.9.3 under your .rvm directory. To make the Ruby the default one we run
rvm use --default 1.9.3
Now let us install the Ruby Gem Mysql2 which is needed for mostly everything I do. It may be possible that we need some dependencies depending on your system. On my Ubuntu 12.04 installation I did not need to install the dependencies but have seen it in the wild being asked so this command might save you some headaches...
sudo apt-get install mysql-client mysql-server libmysql-ruby libmysqlclient-dev
To install the Ruby Gem Mysql2 run the following command in you Ubuntu 12.04 installation
rvm 1.9.3 do gem install mysql2
If you installed Ruby 1.9.3 then the command to install Mysql2 will be exactly like above. If you used a different version of Ruby then make sure you put the version or full Ruby name and replace 1.9.3 above with your needs.
If you need to fall back to your system's Ruby that might have been pre-installed you can use the following command:
rvm use system
UPDATE
To have your terminal behave properly with Ubuntu 12.04 after you reboot we need to set the
> Run command as login shell
setting. To do that open up a terminal by pressing CTRL+ALT+t. Once your terminal is open, right click the terminal, and click on Profiles then Profile Preferences.
Now click on the Title and Command tab. Check Run command as a login shell. Now close the window.
Now we need to do one more thing. Run the following command in the terminal:
gedit ~/.bash_profile
This will open a text editor where we will add the following two lines:
source ~/.profile source ~/.bashrc
The reason this works is because we told the terminal to start as a login shell. This fixes an issue with RVM that happens when the terminal can't recognize RVM.
来源:http://www.andrehonsberg.com/article/install-rvm-ubuntu-1204-linux-for-ruby-193
亦可以参考:https://rvm.io/rvm/install
相关推荐
`RVM`(Ruby Version Manager)是解决这一问题的利器,它允许开发者在多个Ruby版本之间轻松切换。本文将详细介绍如何安装RVM以及如何通过RVM将Ruby版本升级到3.0.0,同时也会提及在安装Redis过程中遇到的问题和解决...
### RVM + Ruby 1.9.3 + Rails 3 安装与配置指南 #### 一、前言 在 Windows 7 环境下搭建 Rails 3 开发环境是一项颇具挑战性的任务,尤其是当涉及到 Cygwin、Ruby、Rails 以及一系列其他必要的组件时。本文将详细...
/usr/local/rvm/rubies/ruby-2.1.0/lib/ruby/2.1.0/pathname.rb:422:in `open': No such file or directory @ dir_initialize – /Users/David/.cocoapods/repos (Errno::ENOENT) from /usr/local/rvm/rubies/ruby-...
在安装redis集群的时候,我们按照网站上的部署文档需要安装rvm,然后再安装ruby2.4.4会导致ctrl+c功能失效...现在这里的rvm的tar包,解压后在rvm/rubies/,就已经有了ruby2.4.4配置一下环境变量ruby就相当于安装好了。
2. **安装RVM(Ruby Version Manager)**: RVM是一个便捷的工具,用于管理不同的Ruby版本。首先,添加RVM的GPG密钥: ``` gpg --keyserver keyserver.ubuntu....
rvm-capistrano, rvm/Capistrano 集成 gem 描述rvm/Capistrano 集成 gem兼容性带Autolibs的rvm-capistrano 1.3.0 至少需要 RVM 1.19.0 。如果你使用 capistrano 3.0.0,则无法使用这里选项,请将它的扩展到
ruby、rvm离线安装包 可用于 redis5.0 以下版本的集群安装部署,解压后,对相关资源进行编译安装即可,应用安装方法可参考:https://blog.csdn.net/qq_42177284/article/details/128924576#3221__236 ruby 版本号为...
解决 Rails bundle 安装不上 mysql gem包的问题 环境 ubuntu 12.04 ruby-2.1.1 首先 新建一个的一个项目,在该项目上执行.../home/wh/.rvm/gems/ruby-2.1.1@xxx/extensions/x86_64-linux/2.1.0/mysql2-0.3.16/gem_make.
然后,我们需要添加Ruby版本管理器RVM(Ruby Version Manager)到系统中。RVM允许你轻松地安装、切换和管理多个Ruby版本。在终端中输入以下命令来安装RVM: ```shell \curl -sSL https://get.rvm.io | bash -s ...
RVM(Ruby Version Manager)是管理Ruby版本的重要工具,它允许开发者在同一个系统上安装和切换多个Ruby版本,方便进行项目间的切换和测试。本教程将详细介绍如何安装Ruby的RVM包,特别是针对Ruby版本大于等于2.0.0...
RVM(Ruby Version Manager)是由 Wayne E. Seguin 开发的一款强大的命令行工具,旨在帮助用户轻松地管理和切换 Ruby 不同版本以及相关 Gem 环境。RVM 提供了一种简单的方法来安装多个 Ruby 解释器,并且可以在不同...
这可以通过Ruby Installer(对于Windows用户)或使用像RVM(Ruby Version Manager)或rbenv(Ruby环境管理器)这样的工具完成,它们允许你轻松地切换和管理不同的Ruby版本。 2. 配置Gem源:默认情况下,Ruby会连接...
通常,我们可以从官方源码编译安装,或者使用RVM(Ruby Version Manager)来管理多个版本的Ruby。这里我们以源码安装为例: 1. 下载最新版的Ruby源码: ```bash wget ...
1. 安装RVM(Ruby Version Manager)是搭建Rails环境的关键。首先,更新软件包列表: ``` sudo apt-get update ``` 2. 安装curl,用于后续安装RVM: ``` sudo apt-get install curl ``` 3. 使用curl安装RVM: ...
RVM(Ruby Version Manager)是一个 Ruby 版本管理工具,能够帮助我们管理多个 Ruby 版本。安装 RVM 是配置 Ruby On Rails 开发环境的第一步。安装 RVM 成功后,需要载入 RVM 环境。 三、安装 Ruby 在安装 Ruby ...
要在 Linux 系统上安装 RVM ,可以打开终端输入: $ \curl -L https://get.rvm.io | bash -s stable 它会自动创建一个“ $HOME/.rvm ”文件夹,这是 RVM 的工作目录。在此文件夹中,有三个文件夹: scripts 、...
Ruby Version Manager (RVM) 是一个非常实用的工具,允许用户在单个系统上安装并切换不同版本的Ruby。要安装RVM,你需要执行以下步骤: 1. 更新系统包: ```bash sudo yum update -y ``` 2. 安装必要的依赖: ...
#### 五、安装 RVM (Ruby Version Manager) - 使用 `curl` 命令下载 RVM 安装脚本至 `/opt/ruby_on_rails/rvm` 目录。 - 解压并运行安装脚本:`tar --strip-components=1 -xzf ../rvm-stable.tar.gz` 和 `./install ...
RVM是Ruby enVironment Manager的首字母缩写。 它管理Ruby应用程序环境并实现它们之间的切换。 主页和更多信息,为 目录 安装RVM 的Ubuntu RVM具有专用的Ubuntu软件包,因此请遵循此处发布的说明: : 如果您...