简体   繁体   English

错误:找不到Rails命令

[英]Error: Rails command not found

I created a new Rails project in a directory, say Desktop ( rails new project1 ). 我在一个名为Desktop的目录中创建了一个新的Rails项目( rails new project1 )。 After that, I ran the following command: 之后,我运行了以下命令:

rails server

Then, the project1 was running on localhost. 然后,project1在本地主机上运行。

After that, I made another directory with name (project1) in another location. 之后,我在另一个位置创建了另一个名称为(project1)的目录。 I copied all the files from the previous location to new location. 我将所有文件从以前的位置复制到了新位置。 After that, when I ran the following command: 之后,当我运行以下命令时:

rails server  

I got the following error message: 我收到以下错误消息:

Rails is not currently installed on this system.

But it is working in the previous directory. 但它在先前的目录中工作。 How do I solve this? 我该如何解决?

If you are totally new to Rails development and System administration it is rather complicated in the beginning. 如果您完全不熟悉Rails开发和系统管理,那么一开始它会非常复杂。 I recommend any kind of Rails tutorial to you for examply by Michael Hartl . 我建议您使用Michael Hartl提供的任何类型的Rails教程。

As Graeme McLean points out you somewhen understand that there is information about your environment needed to help you. 正如格雷姆·麦克莱恩(Graeme McLean)指出的那样,您了解某些环境信息可以为您提供帮助。

Most likely the requirements you need to be set up are not set up in the place you did copy your rails project as Pavan and Thaha kp pointed out. 正如Pavan和Thaha kp所指出的,很可能您未设置Rails项目的地方就没有设置您需要设置的需求。

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

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