5

我有一个奇怪的问题:我在 rvm 上的 rails 上安装了 ruby​​。一切正常,我可以创建项目了。但是当我输入“rails new”重新启动后,我有“程序'rails'当前没有安装。”。

System Ubuntu 12.04

ruby -v
"1.9.3p194"

gem list
actionmailer (3.2.5)
actionpack (3.2.5)
activemodel (3.2.5)
activerecord (3.2.5)
activeresource (3.2.5)
activesupport (3.2.5)
arel (3.0.2)
builder (3.0.0)
bundler (1.1.4)
coffee-rails (3.2.2)
coffee-script (2.2.0)
coffee-script-source (1.3.3)
erubis (2.7.0)
execjs (1.4.0)
hike (1.2.1)
i18n (0.6.0)
journey (1.0.3)
jquery-rails (2.0.2)
json (1.7.3)
mail (2.4.4)
mime-types (1.18)
multi_json (1.3.6)
polyglot (0.3.3)
rack (1.4.1)
rack-cache (1.2)
rack-ssl (1.3.2)
rack-test (0.6.1)
rails (3.2.5)
railties (3.2.5)
rake (0.9.2.2)
rdoc (3.12)
rubygems-bundler (1.0.2)
rvm (1.11.3.3)
sass (3.1.19)
sass-rails (3.2.5)
sprockets (2.1.3)
sqlite3 (1.3.6)
thor (0.15.2)
tilt (1.3.3)
treetop (1.4.10)
tzinfo (0.3.33)
uglifier (1.2.4)
4

3 回答 3

7

将此添加到 ~/.bashrc 文件的底部:

[[ -s "$HOME/.rvm/scripts/rvm" ]] && source "$HOME/.rvm/scripts/rvm"

如果这不起作用,请尝试:

[[ -s "/home/yourusername/.rvm/scripts/rvm" ]] && source "/home/yourusername/.rvm/scripts/rvm"
于 2012-06-07T02:00:41.013 回答
1

Terminal-> Edit-> Profile Preferences-> Title and Command->Run command as a login shell

于 2014-10-24T09:53:15.543 回答
0

我想你需要编辑你的终端设置

只需尝试 https://beatreader.wordpress.com/2016/08/09/ruby-on-rails-problemmissing-after-reboot/ 或者每次打开终端时都需要运行此代码

源“$HOME/.rvm/scripts/rvm”
于 2016-08-09T09:29:49.823 回答