Rails 命令错误 [英] Rails command Error

查看:34
本文介绍了Rails 命令错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我即将开始在另一个 Web 应用程序上工作,我将目录更改为

Im about to start work on another web application, I change directories to

/rails_projects

/rails_projects

然后输入

导轨新空白

然后我收到此错误

Error: Command not recognized
Usage: rails COMMAND [ARGS]

The common rails commands available for engines are:
 generate    Generate new code (short-cut alias: "g")
 destroy     Undo code generated with "generate" (short-cut alias: "d")

All commands can be run with -h for more information.

If you want to run any commands that need to be run in context
of the application, like `rails server` or `rails console`,
you should do it from application's directory (typically test/dummy).

我已经重新安装了 rails,但还是同样的错误,有什么想法吗?

I have reinstalled rails, and still same error, any ideas?

更新:

当我输入时它实际上给了我同样的错误

It actually give me the same error when I type just

导轨 -h

导轨

在cmd中

推荐答案

如果有人遇到此错误并需要最后的解决方案.

If anyone runs into this error and needs a last resort plan.

我最终卸载了 rails、rvm,并安装了较新版本的 ruby​​ 和新的 gemset.

I ended up uninstalling rails, rvm, and installing a newer version of ruby and new gemset.

rvm implode
gem uninstall rails -v=4.0.2
gem uninstall railities

安装 rvm :

curl -L https://get.rvm.io | bash -s
rvm get stable

对于 Mac:

brew install libtool libxslt libksba openssl
brew install libyaml

安装红宝石:

rvm install 2.0.0 --with-openssl-dir=$HOME/.rvm/usr

如果有错误

rvm install 2.0.0 --with-openssl-dir=$HOME/.rvm/opt/openssl

从网站安装新的 ruby​​ gem.解包然后进入文件夹并运行

install new ruby gems from website. Unpackage it then go to folder and run

ruby setup.rb
gem update --system 2.1.9

安装 rails(你可以选择你的版本)

install rails (you can choose your version)

gem install rails --version 4.0.2
gem install railties

我这样做了,现在系统又正常工作了.

I did this, and now system is working normal again.

这篇关于Rails 命令错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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