Rails 3 关于 Fedora 的问题
我一直在尝试在 Fedora 中安装 Rails 3,它要求 Ruby 为 1.8.7 或 1.9.2。 Fedora 官方 yum 存储库有 Ruby 1.8.6,但没有用。于是决定自己从源码编译,下载源码,编译安装成功。
但是安装后会发生这种奇怪的事情,sudo gem 或 sudo ruby 不起作用,它只是返回说找不到命令。
which ruby
/usr/local/bin/ruby
ruby -v
ruby 1.9.2p0 (2010-08-18 revision 29036) [x86_64-linux]
sudo ruby
sudo: ruby: command not found
sudo echo $PATH
/usr/kerberos/sbin:/usr/kerberos/bin:/usr/local/bin:/usr/bin:/bin:/usr/local/sbin:/usr/sbin:/sbin
我是否遗漏了一些东西,为什么它在 PATH 中找不到 ruby?
I have been trying to get Rails 3 installed in Fedora, it requires Ruby to be 1.8.7 or 1.9.2. Fedora official yum repos have Ruby 1.8.6 which is of no use. So I decided to compile it myself from the source, downloaded the source, compiled it and installed it successfully.
But this weird thing happens after the install, sudo gem or sudo ruby are not working, it just returns saying command not found.
which ruby
/usr/local/bin/ruby
ruby -v
ruby 1.9.2p0 (2010-08-18 revision 29036) [x86_64-linux]
sudo ruby
sudo: ruby: command not found
sudo echo $PATH
/usr/kerberos/sbin:/usr/kerberos/bin:/usr/local/bin:/usr/bin:/bin:/usr/local/sbin:/usr/sbin:/sbin
Am I missing something, why doesnt it find ruby when its in the PATH?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
检查您的 PATH 变量(在 .bash_profile 或 .bashrc 文件中设置,将 /usr/local/bin 添加到 PATH 前面:
PATH=/usr/local/bin:$PATH
我建议您查看 RVM——迄今为止,这是安装和在不同 Ruby 版本之间切换以及为每个版本独立维护 Gems 的最佳方式!
https://rvm.io
使用 RVM 比手动编译容易得多,并且它可以让您的所有 Gems 按 Ruby 版本组织起来!
上面还有一个 RailsCast:http://railscasts.com /episodes/200-rails-3-beta-and-rvm
check your PATH variable (set in your .bash_profile or .bashrc file, add /usr/local/bin to the front of the PATH:
PATH=/usr/local/bin:$PATH
I'd recommend that you check out RVM -- so far the best way to install and switch between different Ruby versions and to maintain Gems independently for each version!
https://rvm.io
Using RVM is much easier than compiling by hand, and it keeps all your Gems organized by Ruby version!
There's also a RailsCast on it: http://railscasts.com/episodes/200-rails-3-beta-and-rvm