小编use*_*471的帖子

RVM不是一个函数,用'rvm use ...'选择rubies是行不通的

列出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)

ruby bash rvm

142
推荐指数
11
解决办法
8万
查看次数

validates_length_of :maximum 和 :minimum on ruby​​ on rails 的自定义错误消息

我想为 :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)

ruby ruby-on-rails ruby-on-rails-3 ruby-on-rails-4

3
推荐指数
1
解决办法
2314
查看次数