sudo gem install rails - 这并没有给我一个用于 bash 的 rails 命令 [英] sudo gem install rails- this doesn't give me a rails command for bash

查看:37
本文介绍了sudo gem install rails - 这并没有给我一个用于 bash 的 rails 命令的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在 Ubuntu 上.我输入 sudo gem install rails.这很好用,可以很好地安装 railes 和 7 个其他 gem.然而 $ rails blog 是这样说的:

I'm on Ubuntu. I type in sudo gem install rails. This works fine, installs railes and 7 other gems fine. Yet $ rails blog is saying this:

The program 'rails' is currently not installed.  You can install it by typing:
sudo apt-get install rails

推荐答案

作为管理员或用户,您是如何安装 ruby​​gems 的?如果您以用户身份安装它,它的路径中可能没有 bin 目录.

how did you install rubygems, as an admin, or as a user? if you installed it as a user, it may not have the bin directory in your path.

如果我是你,(假设你将 ruby​​gems 安装到你的主文件夹中),我会丢弃那个安装目录(不确定它的默认位置,可能是 ~/rubygems?还是 ~/.rubygems?),然后运行 ​​setup.来自 ruby​​gems tarball 的 rb 以管理员身份(通过 sudo)我在 ubuntu 上已经完成了至少十几次,并且没有遇到您遇到的问题.

If I were you, (assuming you installed rubygems into your home folder), I would trash that installation dir (not sure where it defaults to, maybe ~/rubygems? or ~/.rubygems?), then run setup.rb from the rubygems tarball as admin (through sudo) I've done this at least a dozen times on ubuntu, and haven't run into the issue you are hitting.

如果不是这样,您能否链接到您关注的博客文章?

If that isn't the case, could you please link to the blog post you were following?

这篇关于sudo gem install rails - 这并没有给我一个用于 bash 的 rails 命令的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆