Ruby on rails rails服务器未启动-尝试使用rails 3运行ryan bates railscasts应用程序的代码
我正在尝试使用ryan bates的示例代码,他在Daemon上使用railscast(第129集)。我已经安装了rails 3,当我下载他的代码时,我无法运行服务器。为了尝试解决这个问题,我从一个标准的rails 3应用程序复制了我的gemfile和gemfile.lock,并将其放入他的应用程序中,然后运行bundle安装。不过,我的rails服务器没有响应。相反,我得到以下信息(见下文) 我的猜测是我遇到了问题,因为railscasts使用Rails2(我相信),而我使用的是Rails3。有没有办法让我继续使用他的程序 谢谢 用法:Ruby on rails rails服务器未启动-尝试使用rails 3运行ryan bates railscasts应用程序的代码,ruby-on-rails,ruby-on-rails-3,railscasts,Ruby On Rails,Ruby On Rails 3,Railscasts,我正在尝试使用ryan bates的示例代码,他在Daemon上使用railscast(第129集)。我已经安装了rails 3,当我下载他的代码时,我无法运行服务器。为了尝试解决这个问题,我从一个标准的rails 3应用程序复制了我的gemfile和gemfile.lock,并将其放入他的应用程序中,然后运行bundle安装。不过,我的rails服务器没有响应。相反,我得到以下信息(见下文) 我的猜测是我遇到了问题,因为railscasts使用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
说明:
railsnew
命令使用默认值创建一个新的rails应用程序
指定路径处的目录结构和配置
例如:
rails new ~/Code/Ruby/weblog
这将在~/code/Ruby/weblog
中生成一个骨架Rails安装
请在新创建的应用程序中查看自述文件,以便开始使用 要在rails 3中运行服务器,您应该使用源文件夹中的以下命令:
rails server
但我认为安装Rails2和适当版本的ruby比试图解决从Rails2迁移到Rails3的问题更容易。要在不同的ruby版本之间切换,您可以使用。这种方法行不通。rails 3.x和2.x之间有太多的差异(rails命令的不同行为、不同的配置、绑定器等) 我将创建一个新的rails项目,并从屏幕广播中复制应用程序文件夹
无论如何,这不是一个好主意,因为rails 2.x中使用的gem与rails 3.x中的gem不同,因此您很可能会在这种方法中遇到一些错误。您正在运行什么命令?您需要使用“ruby脚本/服务器”。。“rails服务器”适用于rails>=3.0根据指南,使用的版本是2.1.0。最好安装2.1.0,或者尝试使用更高版本的rails转换较旧的应用程序