[英]ruby on rails -v gives error
i am getting this error below 我在下面收到此错误
/usr/lib64/ruby/site_ruby/1.8/rubygems.rb:926:in `report_activate_error': Could not find RubyGem rails (>= 0) (Gem::LoadError)
from /usr/lib64/ruby/site_ruby/1.8/rubygems.rb:244:in `activate_dep'
from /usr/lib64/ruby/site_ruby/1.8/rubygems.rb:236:in `activate'
from /usr/lib64/ruby/site_ruby/1.8/rubygems.rb:1307:in `gem'
from /usr/bin/rails:18
i started with a ruby 1.8.7 & rails 2.3.11 then i installed rvm then installed ruby 2.0.0 & gem install rails 3.2.13 then started getting this error above. 我从ruby 1.8.7&rails 2.3.11开始,然后我安装了rvm,然后安装了ruby 2.0.0&gem install rails 3.2.13,然后开始收到上面的错误。 any help will be appreciated, thanks.
任何帮助将不胜感激,谢谢。 i think it's a path issue of some sort but can't figure out, don't know much about unix stuff.
我认为这是某种路径问题,但无法弄清楚,对Unix的东西了解不多。 i don't have root privs by the way.
顺便说一下,我没有root privs。
this is my .bashrc if helps 这是我的.bashrc,如果有帮助
# .bashrc
# User specific aliases and functions
alias mv='mv -i'
alias rm='rm -i'
alias cp='cp -i'
# Source global definitions
if [ -f /etc/bashrc ]; then
. /etc/bashrc
fi
PATH=$PATH:$HOME/.rvm/bin # Add RVM to PATH for scripting
export HPATH=$HOME
export GEM_HOME=$HPATH/ruby/gems
export GEM_PATH=$GEM_HOME:/usr/lib64/ruby/gems/1.8
export GEM_CACHE=$GEM_HOME/cache
export PATH=$PATH:$HPATH/ruby/gems/bin
export PATH=$PATH:$HPATH/ruby/gems
this is .bash_profile 这是.bash_profile
# .bash_profile
# Get the aliases and functions
if [ -f ~/.bashrc ]; then
. ~/.bashrc
fi
# User specific environment and startup programs
PATH=$PATH:$HOME/bin
export PATH
unset USERNAME
[[ -s "$HOME/.rvm/scripts/rvm" ]] && source "$HOME/.rvm/scripts/rvm" # Load RVM$
rvm use 2.0.0
will switch to ruby 2.0.0 将切换到ruby 2.0.0
You can then install rails and create a gemset named rails-3.2.13 然后,您可以安装rails并创建一个名为rails-3.2.13的gemset。
rvm use 2.0.0@rails-3.2.13 --create
then 然后
gem install rails -v 3.2.13
you can also pass the --default
switch to make 2.0.0
the default ruby 您还可以通过
--default
开关将2.0.0
为默认红宝石
you can see a list if all installed ruby versions and which one is current and or default using 您会看到一个列表,其中列出了所有已安装的ruby版本,以及使用以下版本的当前版本和默认版本
rvm list
this produces output like this 这会产生这样的输出
rvm rubies
ruby-1.9.3-p385 [ x86_64 ]
=* ruby-1.9.3-p392 [ x86_64 ]
ruby-2.0.0-p0 [ x86_64 ]
# => - current
# =* - current && default
# * - default
UPDATE 更新
Also, This seems like a PATH
issue since your last comment. 此外,自您上次评论以来,这似乎是
PATH
问题。 Im not sure about your bash_profile
but the PATH
may be wrong for rvm. 我不确定您的
bash_profile
但是rvm的PATH
可能错误。 Just use 只需使用
export PATH="/usr/local/bin:/usr/local/sbin:/usr/local/mysql/bin:$PATH"
# Load RVM into a shell session *as a function*
[[ -s "$HOME/.rvm/scripts/rvm" ]] && source "$HOME/.rvm/scripts/rvm"
in your bash_profile
在您的
bash_profile
and in your `.bashrc' try this 并在您的`.bashrc'中尝试
PATH=$PATH:$HOME/.rvm/bin # Add RVM to PATH for scripting
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.