一个人如何“跑步”?在本地服务器上从源代码下载 Rails 项目
我很乐意启动自己的 Rails 项目,但我正在尝试查看并在本地服务器上运行从 github 等下载的源代码。
我已经下载了许多源代码(例如,railscasts 站点提供的源代码)。然后我 cd到相关目录和 Rails 服务器,然后我得到标准的 Rails 帮助表开头:
Usage:
rails new APP_PATH [options]
Options:
-r, [--ruby=PATH] # Path to the Ruby binary of your choice
localhost:3000 显然也没有指向我
正在运行的 Rails 3 应用程序,我相信我已经尝试过使用 Rails 3 应用程序,但没有成功。
我立即想到的是,我需要执行一些标准任务,例如安装适当的 gem 等,但我不确定,并且在查看其他应用程序时遇到了一些障碍。问题(因为我认为这是很明显的)
I'm comfortable with starting my own rails project but am trying to view and run on a local server downloaded source codes from github etc.
I have downloaded a number of source codes (for example, those provided by the railscasts site. I then cd to the relevant directory and rails server
. I then get the standard rails help sheet beginning:
Usage:
rails new APP_PATH [options]
Options:
-r, [--ruby=PATH] # Path to the Ruby binary of your choice
localhost:3000 also obviously doesn't then point me to the app
I am running rails 3 and I believe I have tried this with rails 3 apps and had no luck.
My immediate thoughts are that I need to do some standard tasks like install the appropriate gems etc. but I'm not sure and come up against a bit of block from looking at other questions (as I presume it is so obvious)
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
这在一定程度上取决于所包含的 Rails 版本。较旧的 Railscasts 源代码位于 Rails 2.x 中,这需要您使用该版本的 Rails。
你能做的最好的事情就是安装RVM,这样你就可以安装多个版本的Ruby和Rails。为 Rails 3.0 和 Rails 2.3 创建 gemset,并在运行较旧的 Rails 应用程序(使用
script/server
而不是rails server
运行)时使用 Rails 2.3 gemset。It depends somewhat on the version of Rails that's included. Older Railscasts source would be in Rails 2.x, which would require you use that version of rails.
The best thing you can do is install RVM so that you can have multiple versions of Ruby and Rails installed. Create gemsets for Rails 3.0 and Rails 2.3, and use the Rails 2.3 gemset when running older Rails apps (which are run using
script/server
rather thanrails server
).