首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >为什么每次打开新终端都要安装Rails?

为什么每次打开新终端都要安装Rails?
EN

Stack Overflow用户
提问于 2013-01-23 06:49:39
回答 3查看 2.1K关注 0票数 1

我对Ruby On Rails有点问题。每次我打开一个新的终端并输入一个Rails命令时,我都会得到这个错误:

代码语言:javascript
复制
rails --version
Sorry, command-not-found has crashed! Please file a bug report at:
https://bugs.launchpad.net/command-not-found/+filebug
Please include the following information with the report:

command-not-found version: 0.3
Python version: 3.2.3 final 0
Distributor ID: Ubuntu
Description:    Ubuntu 12.10
Release:    12.10
Codename:   quantal
Exception information:

unsupported locale setting
Traceback (most recent call last):
  File "/usr/lib/python3/dist-packages/CommandNotFound/util.py", line 24, in crash_guard
    callback()
  File "/usr/lib/command-not-found", line 69, in main
    enable_i18n()
  File "/usr/lib/command-not-found", line 40, in enable_i18n
    locale.setlocale(locale.LC_ALL, '')
  File "/usr/lib/python3.2/locale.py", line 541, in setlocale
    return _setlocale(category, locale)
locale.Error: unsupported locale setting

我可以避免这个问题的唯一方法是重新安装Ruby和Rails,我对此有点厌倦了,因为我每次打开一个新的终端都必须这样做。

我尝试使用以下命令执行完全卸载:

代码语言:javascript
复制
rvm implode

但没有成功。

我也尝试了这些命令,但仍然没有成功:

代码语言:javascript
复制
rvm --default use 1.9.2 (or whatever you want your default ruby interpreter to be)
rvm gemset create rails-3.0.3
rvm use 1.9.2@rails-3.0.3 --default
gem install rails
EN

回答 3

Stack Overflow用户

回答已采纳

发布于 2013-01-23 07:38:33

可能你只需要将RVM添加到PATH中以进行脚本编写。

将以下行添加到~/.bashrc文件中。

代码语言:javascript
复制
PATH=$PATH:$HOME/bin/sublime_text/:$HOME/bin/cad_cuda/:$HOME/.rvm/bin
[[ -s "$HOME/.rvm/scripts/rvm" ]] && source "$HOME/.rvm/scripts/rvm"
票数 3
EN

Stack Overflow用户

发布于 2013-01-23 06:54:12

看起来您正在尝试使用rvm -检查安装文档,并确保在启动新shell时将代码添加到设置RVM的shell启动过程中。

https://rvm.io/rvm/install/

查找"2.将RVM作为函数加载到shell会话中“

票数 1
EN

Stack Overflow用户

发布于 2013-01-23 06:59:29

当我在我的Ubuntu机器上安装rails时,我使用了这个逐步指南。http://coding.smashingmagazine.com/2011/06/21/set-up-an-ubuntu-local-development-machine-for-ruby-on-rails/

我无法想象是什么导致了您的问题,但我自己也遇到了一些问题,因为一些依赖项出现在错误的版本中。做一个完整的更新可能会有所帮助。

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/14469517

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档