我正在尝试使用ryan bates的示例代码,他在Daemon上使用了他的铁路广播(第129集)。我安装了Rails3,当我下载他的代码时,我不能运行服务器。为了解决这个问题,我从一个标准的Rails3应用程序中复制了我的gemfile和gemfile.lock,并将其放入他的应用程序中,然后运行包安装。尽管如此,我的rails服务器仍然没有响应。相反,我得到了以下内容(见下文)。
我的猜测是我遇到了问题,因为rails广播使用的是Rails2(我相信),而我使用的是Rails3。有没有办法让我仍然可以使用他的程序?
谢谢。
用法:
rails new APP_PATH [options]选项:
-r, [--ruby=PATH] # Path to the Ruby binary of your choice
# Default: /home/kyala/.rvm/rubies/ruby-1.9.2-p290/bin/ruby
-d, [--database=DATABASE] # Preconfigure for selected database (options: mysql/oracle/postgresql/sqlite3/frontbase/ibm_db)enter code here
# Default: sqlite3
-b, [--builder=BUILDER] # Path to an application builder (can be a filesystem path or URL)
-m, [--template=TEMPLATE] # Path to an application template (can be a filesystem path or URL)
[--dev] # Setup the application with Gemfile pointing to your Rails
checkout
[--edge] # Setup the application with Gemfile pointing to Rails
repository
[--skip-gemfile] # Don't create a Gemfile
-O, [--skip-active-record] # Skip Active Record files
-T, [--skip-test-unit] # Skip Test::Unit files
-J, [--skip-prototype] # Skip Prototype files
-G, [--skip-git] # Skip Git ignores and keeps
Runtime options:
-f, [--force] # Overwrite files that already exist
-p, [--pretend] # Run but do not make any changes
-q, [--quiet] # Supress status output
-s, [--skip] # Skip files that already exist
Rails options:
-v, [--version] # Show Rails version number and quit
-h, [--help] # Show this help message and quit描述:rails new命令在您指定的路径下创建一个具有默认目录结构和配置的新Rails应用程序。
示例:
rails new ~/Code/Ruby/weblog这将在~/Code/Ruby/weblog中生成一个框架Rails安装。
请参阅新创建的应用程序中的自述文件以开始使用。
发布于 2012-01-20 23:21:47
这样是行不通的。rails 3.x和2.x之间有太多的差异( rails命令的不同行为、不同的配置、捆绑等)。
我会创建一个新的rails项目,然后从截屏视频中复制应用程序文件夹。
无论如何,这不是一个好主意,因为在Rails2.x中使用的gem与在rails 3.x中使用的gem是不同的,所以使用这种方法很可能会遇到一些错误。
发布于 2012-01-20 21:58:13
要在rails 3中运行服务器,您应该在源文件夹中使用以下命令:
rails server但是我认为安装Rails2和相应的ruby版本要比解决从Rails2迁移到Rails3的问题容易得多。要在不同的ruby版本之间切换,你可以使用rvm。
https://stackoverflow.com/questions/8936014
复制相似问题