列出ruby版本
console:~$ rvm list
rvm rubies
ruby-2.0.0-p481 [ i686 ]
# => - current
# =* - current && default
# * - default
Run Code Online (Sandbox Code Playgroud)
尝试使用特定版本的ruby
console:~$ rvm use 2.0.0
RVM is not a function, selecting rubies with 'rvm use ...' will not work.
You need to change your terminal emulator preferences to allow login shell.
Sometimes it is required to use `/bin/bash --login` as the command.
Please visit https://rvm.io/integration/gnome-terminal/ for a example.
Run Code Online (Sandbox Code Playgroud) 我想为 :minimum 和其他为 :maximum 编写自定义错误消息
我有以下代码行
validates_length_of :user_name, :minimum=>5,:maximum=>30
ej if the length of :user_name is < 5 "The user_name must to have 5 characters as minimum"
ej if the length of :user_name is > 30 "The user_name must to have 30 characters as maximum"
Run Code Online (Sandbox Code Playgroud)