【问题标题】:"gem install rails" is 100% and the "rails" is in the "gem list", but I failed to run "rails -v"“gem install rails”是 100%,“rails”在“gem list”中,但我没有运行“rails -v”
【发布时间】:2015-06-21 04:46:17
【问题描述】:

我已经通过 gem 安装了 rails。当它完成 100% 时。我在宝石列表中检查了它。但我未能运行“rails -v”。您可以通过以下方式获取更多信息

[root@wlin log]# gem list
... suppresed ....
[root@wlin log]# rails -v
bash: rails: not found the command...

【问题讨论】:

    标签: ruby-on-rails gem


    【解决方案1】:

    你得到 bash 找不到rails 命令的原因可能是因为rails 不在PATH 变量中。 要将其添加到PATH,您可以这样做

    export PATH=$PATH:/path/to/rails

    其中/path/to/rails 表示rails 可执行文件的绝对路径。 我不确定您在哪个平台上,但您可以通过在 INSTALLATION DIRECTORY 的 rails 子目录中查找 bin 文件夹来找到它所在的位置,可以通过调用找到该文件夹​​

    gem env

    希望这能解决您的问题! :)

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2014-06-09
      • 2014-02-01
      • 1970-01-01
      • 2013-11-30
      • 1970-01-01
      • 1970-01-01
      • 2021-03-30
      相关资源
      最近更新 更多