git 如何克隆和运行另一个用户的 Rails 应用程序

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/22167838/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-19 09:47:40  来源:igfitidea点击:

How to clone and run another user's Rails app

ruby-on-railsgit

提问by Martyn

I'm attempting to do something I've never done before: clone another user's (codeforamerica) repository and run it locally on my computer with the intention of making my own changes to it.

我正在尝试做一些我以前从未做过的事情:克隆另一个用户的(codeforamerica)存储库并在我的计算机上本地运行它,目的是对它进行自己的更改。

I've managed to fork it to my own repositories, and cloned it:

我已经设法将它分叉到我自己的存储库中,并克隆了它:

git clone https://github.com/martynbiz/human_services_finder.git

...but when I do the following straight out the box:

...但是当我直接执行以下操作时:

cd human_services_finder
rails s

...it tell me:

...它告诉我:

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

...however, if I go into one of my own apps and run rails sit runs the server OK. Is there something missing I need to run this as a Rails app? Sorry, bit of a beginner with this one. Thanks

...但是,如果我进入我自己的应用程序之一并运行rails s它,则服务器运行正常。我需要将它作为 Rails 应用程序运行时缺少什么吗?抱歉,这个有点初学者。谢谢

回答by Pravin Mishra

Below are the setups to run Ruby on Rails application on your system.

以下是在您的系统上运行 Ruby on Rails 应用程序的设置。

  1. Make sure Ruby is installed on your system. Fire command prompt and run command:

    ruby -v
    
  2. Make sure Rails is installed

    rails -v
    
  1. 确保您的系统上安装了 Ruby。触发命令提示符并运行命令:

    ruby -v
    
  2. 确保安装了 Rails

    rails -v
    

If you see Ruby and Rails version then you are good to start, other wise Setup Ruby On Rails on Ubuntu

如果您看到 Ruby 和 Rails 版本,那么您就可以开始了,否则在 Ubuntu 上设置 Ruby On Rails

Once done, Now

一旦完成,现在

  1. Clone respected git repository

    git clone https://github.com/martynbiz/human_services_finder.git
    
  2. Install all dependencies

    bundle install
    
  3. Create db and migrate schema

    rake db:create
    rake db:migrate
    
  4. Now run your application

    rails s
    
  1. 克隆受人尊敬的 git 存储库

    git clone https://github.com/martynbiz/human_services_finder.git
    
  2. 安装所有依赖

    bundle install
    
  3. 创建数据库并迁移架构

    rake db:create
    rake db:migrate
    
  4. 现在运行你的应用程序

    rails s
    

回答by Severin

You need to install all the dependencies (Gems). This should be possible by running

您需要安装所有依赖项(Gems)。这应该可以通过运行

bundle install

from the applciations directory.

从应用程序目录。

If you are not using RVMyet I would strongly recommend doing so.

如果您还没有使用RVM,我强烈建议您这样做。