简体   繁体   English

关于Fedora问题的Rails 3

[英]Rails 3 on Fedora issues

I have been trying to get Rails 3 installed in Fedora, it requires Ruby to be 1.8.7 or 1.9.2. 我一直试图在Fedora中安装Rails 3,它要求Ruby为1.8.7或1.9.2。 Fedora official yum repos have Ruby 1.8.6 which is of no use. Fedora官方的yum仓库有没有用的Ruby 1.8.6。 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. 但这奇怪的事情发生在安装之后,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

Am I missing something, why doesnt it find ruby when its in the PATH? 我是否缺少某些东西,为什么在PATH中找不到红宝石?

  1. check your PATH variable (set in your .bash_profile or .bashrc file, add /usr/local/bin to the front of the PATH: 检查您的PATH变量(在.bash_profile或.bashrc文件中设置,将/ usr / local / bin添加到PATH的前面:

    PATH=/usr/local/bin:$PATH PATH = / usr / local / bin:$ PATH

  2. 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! 我建议您检查一下RVM,这是迄今为止在不同Ruby版本之间安装和切换以及为每个版本独立维护Gems的最佳方法!

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

    Using RVM is much easier than compiling by hand, and it keeps all your Gems organized by Ruby version! 使用RVM比手工编译要容易得多,它可以使所有Gems保持Ruby版本的组织!

    There's also a RailsCast on it: http://railscasts.com/episodes/200-rails-3-beta-and-rvm 上面还有一个RailsCast: http ://railscasts.com/episodes/200-rails-3-beta-and-rvm

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM