程序“rails"可以在以下软件包中找到 - 某些应用程序和 RVM 有问题? [英] The program 'rails' can be found in the following packages - issue with some app and RVM?

查看:32
本文介绍了程序“rails"可以在以下软件包中找到 - 某些应用程序和 RVM 有问题?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我刚刚从 github 下载了一个应用程序代码,当我尝试运行命令 rails s 时,出现此错误 -

I just downloaded an app code from github and when I am trying to run the command rails s, I am getting this error -

The program 'rails' can be found in the following packages:
 * rails
 * ruby-railties-3.2

这仅针对此应用程序,有人可以告诉我如何解决此问题吗?我正在使用 RVM

This is specific to this app only, can someone tell me how to fix this ? I am using RVM

推荐答案

不太确定您的问题究竟是什么.如果您使用 rvm 并安装了 Rails,则可能必须使用

Not really sure what exactly your problem is. If you use rvm and have installed Rails with it, you may have to use

rvm use 1.9.3

(版本号可能取决于您的安装).那么你可能会或可能没有带有这个的宝石.所以:

(version number may depend on your installation). Then you may or may have not a gemset with this. So:

bundle install

应该在这个 gemset 中安装 Rails gem.也许使用

should install Rails gem in this gemset. Maybe use

rvmsudo bundle install

或者只是手动安装 Rails gem.但这部分取决于应用程序预期的 Rails 版本.还有其他选择,但这应该主要有效.

or just manually install the Rails gem. But this would partially depend on the Rails version expected by the app. There are other options, but this should mostly work.

要永久设置版本,您可以使用:

For setting a version permanently you can use:

rvm use 1.9.3 --default

要让它工作,你必须有这样的东西:

For this to work you must have something like this:

[[ -s "$HOME/.rvm/scripts/rvm" ]] && . "$HOME/.rvm/scripts/rvm"

在你的 ~/.bash_profile 中.

in your ~/.bash_profile.

此外,如果您需要经常在版本之间切换,您可以在项目中设置类似 .rvm 文件夹的内容,您可以在其中设置项目级别的 rvm 选项(我自己没有使用过,但应该有文档rvm主页)

In addition you can have something like a .rvm folder in your project where you can set rvm options on a project level if you need to switch between versins often (didn't use this myself, but there should be docs on the rvm homepage)

这篇关于程序“rails"可以在以下软件包中找到 - 某些应用程序和 RVM 有问题?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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