我没有正确设置 rvm(和 .rvmrc 文件),因此每当我进入我的 RoR 项目目录并键入rails s
或任何其他rails
命令时,我都会收到以下错误
The program 'rails' can be found in the following packages:
* rails
* ruby-railties-3.2
Try: sudo apt-get install <selected package>
我必须输入rvm use 1.9.3-p392
才能修复它。
.rvmrc 文件包含
environment_id="ruby-1.9.3-p392@project1"
if [[ -d "${rvm_path:-$HOME/.rvm}/environments"
&& -s "${rvm_path:-$HOME/.rvm}/environments/$environment_id" ]]
then
\. "${rvm_path:-$HOME/.rvm}/environments/$environment_id"
for __hook in "${rvm_path:-$HOME/.rvm}/hooks/after_use"*
do
if [[ -f "${__hook}" && -x "${__hook}" && -s "${__hook}" ]]
then \. "${__hook}" || true
fi
done
unset __hook
else
# If the environment file has not yet been created, use the RVM CLI to select.
rvm --create "$environment_id" || {
echo "Failed to create RVM environment '${environment_id}'."
return 1
}
fi