本文介绍了当前未安装程序“rails"?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经安装了 Ruby(通过 apt-get 安装了 1.8.7)并安装了 Rails(通过 ruby​​gems 安装了 2.3.2),但是当我输入rails newapp"时,我收到了这个错误:

I've installed Ruby (1.8.7 via apt-get) and I installed Rails (2.3.2 via rubygems) but when I type 'rails newapp', I get this error:

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

当我运行gem list"时,它会显示 rails 及其所有依赖项.知道可能出了什么问题吗?

When I run 'gem list' it shows rails and all of it's dependencies. Any idea what might have gone wrong?

推荐答案

你是如何安装 ruby​​gems 的?我过去在通过 ubuntu 存储库使用它时发现了问题.通常我删除那个包并编译和安装

How did you install rubygems? I've found problems when using it through the ubuntu repositories in the past. Usually I remove that package and compile and install

sudo apt-get remove rubygems
wget http://rubyforge.org/frs/download.php/70696/rubygems-1.3.7.tgz
tar xzvf rubygems-1.3.7.tgz
cd rubygems-1.3.7/
sudo ruby setup.rb
sudo ln -s /usr/bin/gem1.8 /usr/bin/gem

或者你可能只需要符号链接它:

or you may just have to symbolic link it:

sudo ln -s /usr/bin/gem1.8 /usr/bin/gem

这篇关于当前未安装程序“rails"?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-01 14:02