开发者

How does one 'run' on the local server a downloaded rails project from its source code

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 si开发者_Go百科te. 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)


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 than rails server).

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜