1 - Installing RVM
$ sudo gem install rvm
$ (rvm-install已过时)
$ bash < <(curl -s https://rvm.beginrescueend.com/install/rvm)
Finally put this lines in your .bash_profile or .bashrc:
if [[ -s $HOME/.rvm/scripts/rvm ]] ; then
source $HOME/.rvm/scripts/rvm
fi
Restart your terminal, Rvm should be working by now.
2 - Installing ruby inside your rvm
$ rvm install 1.8.7
Will install ruby 1.8.7
$ rvm install ruby-head
Will install ruby 1.9.2 or newer.
3 - Setting up rvm to use your specific ruby version
$ rvm use 1.8.7
To use just this time.
$ rvm use 1.8.7 --default
To use always this version.
If you are using any other ruby replace the “1.8.7” for your version.
4 - Installing rails 2 and rails 3 RC inside different gemsets
firstly select a ruby version
$ rvm use 1.8.7
You can separate your rails versions inside gemsets:
Rails 2:
Create the gemset:
$ rvm gemset create rails2
Setting up rvm to use always this gemset:
$ rvm use 1.8.7@rails2 --default
Installing rails 2:
$gem install rails
#前面不能加sudo,否则就安装到系统默认的gemsets而未安装到rvm的gemsets
$rvm gem list
$gem list
Rails 3:
Create the gemset:
$ rvm gemset create rails3
Setting up rvm to use always this gemset:
$rvm use 1.8.7@rails3 --default
Installing rails 3:
$gem install rails --pre
5 - Switching between different rails versions
Switching back to your system Ruby
rvm system
Back to your Rails3.0 environment
rvm 1.9.2@rails3
Switching to rails 2:
$ rvm use 1.8.7@rails2
$ rails -v
Rails 2.3.5
Switching to rails 3:
$ rvm use 1.8.7@rails3
$ rails -v
Rails 3.0.0.rc
rvm install ree
ERROR: There has been an error while trying to run the ree installer. Halting theinstallation.
Installed ruby 1.9.2 via RVM and getting the following error?
no such file to load -- openssl
Try getting RVM to install the required openssl files. Unfortunately this means removing ruby and installing it again.
rvm pkg install openssl
rvm remove 1.9.2
rvm install 1.9.2 --with-openssl- dir =$HOME/.rvm /usr
But hey, it works.
rvm no such file to load readline
rvm package install readline
rvm remove 1.8.7-p330
rvm install 1.8.7-p330 --with-readline-dir=$rvm_path/usr
Problem
When you try to run the console rails c
in a new Rails 3.0.3 application, and when you use rvm, you get the following error:
no such file to load -- readline (LoadError)
Solution
It’s quite like likely that the readline libraries are missing from your installation. To find out which ones go to the directory that the error is indicating (ie):
$cd /.rvm/src/ruby-1.8.7-p352/ext/readline
$ruby extconf.rb
$make
$sudo make install
If you get something like:checking for readline/readline.h... no
checking for editline/readline.h... no
then you are probably missing the neccessary header files for readline.
1、so install them in your system:
sudo urpmi readline-dev
(ie in Mandriva)
In Debian you will need to install libreadline5-dev and
libncurses5-dev (apt-get install).
When the package is installed successfully run the following again:
ruby extconf.rb
make
sudo make install
You should now be able to go back to your project and run rails c
with no errors.
2、if apt-get error, you can install from src code
从网上下载安装包下来安装
http://ftp.cn.debian.org/debian/pool/main/r/readline5/libreadline5-dev_5.2-7_i386.deb
http://ftp.cn.debian.org/debian/pool/main/n/ncurses/libncurses5-dev_5.7+20100313-5_i386.deb
3、下载 ruby-1.8.7-p352的软件包
找到 ruby-1.8.7-p352/
ext/readline copy to /.rvm/src/ruby-1.8.7-p352/ext/readline
$ruby extconf.rb
$make
$sudo make install
4、安装ruby的版本和系统默认的ruby版本相同
rvm install 1.8.7-p72 --with-openssl-dir=$HOME/.rvm/usr
相关推荐
词集API Wordset API是Rails /葡萄API后端的 。 Wordset 是一个协作的结构化词典。 要使其在本地运行,您还需要克隆和设置 Ember 前端 。先决条件我们使用最新版本的 Ruby,2.1.5。 我们建议使用 RVM 来管理 Ruby ...
在Ruby on Rails开发的世界里,将一个Web应用程序打包成可执行文件可以极大地简化部署和分发过程。这个过程通常涉及到将整个Rails应用及其依赖项封装到一个独立的可执行文件中,使得用户无需安装额外的环境或依赖...
1.将.rb文件和.rhtml文件都保存为utf-8格式; 2.在/app/Controller/application.rb中增加... 您可能感兴趣的文章:Ruby rails 页面跳转(render和redirect_to)学习Ruby你需要了解的相关知识(rvm, gem, bundle, rake, rail
3. **RVM (Ruby Version Manager)**:用于管理和切换不同的Ruby版本。 4. **Ruby**:Redmine的核心运行环境。 5. **RubyGems**:Ruby的包管理器,用于安装和管理Ruby的外部库。 6. **Rails (Ruby on Rails)**:...
rake redmine:plugins:migrate NAME=redmine_work_wechat RAILS_ENV=production ``` 重启 Redmine,进入管理菜单的企业微信配置。 本文指导了您在 CentOS 系统上部署 Redmine 4.1 及远程启动脚本的步骤。Redmine 是...
redis.set('key', 'value') puts redis.get('key') # 输出 "value" ``` Ruby的灵活性使得它能充分利用Redis的各种数据结构和操作,例如发布/订阅消息、事务处理等。 **在Rails应用中使用Redis** 在Ruby on Rails...
mysql -u root -p -e 'CREATE DATABASE redmine CHARACTER SET utf8;' mysql -u root -p -e 'CREATE USER \'redmine\'@\'localhost\' IDENTIFIED BY \'redmine\';' mysql -u root -p -e 'GRANT ALL PRIVILEGES ON...
1. 安装与环境配置:了解如何在不同操作系统上安装Ruby及Ruby on Rails环境,包括Ruby版本管理工具RVM的使用。 2. 基本语法:学习变量、常量、数据类型(如字符串、数字、数组、哈希)、流程控制(条件语句、循环...
3. **安装Rails和Puma**: 使用RVM安装Ruby后,使用`gem install rails`安装Rails,接着安装Puma,执行`gem install puma`。同时,还需要安装`bundler`来管理Gemfile中的依赖,`gem install bundler`。 4. **安装...