Ruby on rails 错误//用法:rails新应用程序路径[选项]//运行时';rails服务器&x27;
背景资料: 我正在使用GIT获取一个包含Ruby文件的项目存储库。该项目位于Mac上主目录下的“我的站点”文件夹中 我有Ruby:1.8.7 我刚刚将Rails升级到:3.0.3 我所要做的就是能够在我已经下载的GIT项目的浏览器中呈现localhost.com:3000,这样我就可以在本地工作了 我运行了命令“rails服务器”,并收到以下消息:Ruby on rails 错误//用法:rails新应用程序路径[选项]//运行时';rails服务器&x27;,ruby-on-rails,upgrade,Ruby On Rails,Upgrade,背景资料: 我正在使用GIT获取一个包含Ruby文件的项目存储库。该项目位于Mac上主目录下的“我的站点”文件夹中 我有Ruby:1.8.7 我刚刚将Rails升级到:3.0.3 我所要做的就是能够在我已经下载的GIT项目的浏览器中呈现localhost.com:3000,这样我就可以在本地工作了 我运行了命令“rails服务器”,并收到以下消息: Usage: rails new APP_PATH [options] Options: [--skip-gemfile]
Usage:
rails new APP_PATH [options]
Options:
[--skip-gemfile] # Don't create a Gemfile
-m, [--template=TEMPLATE] # Path to an application template (can be a filesystem path or URL)
-d, [--database=DATABASE] # Preconfigure for selected database (options: mysql/oracle/postgresql/sqlite3/frontbase/ibm_db)
# Default: sqlite3
-O, [--skip-active-record] # Skip Active Record files
-J, [--skip-prototype] # Skip Prototype files
-T, [--skip-test-unit] # Skip Test::Unit files
[--dev] # Setup the application with Gemfile pointing to your Rails checkout
-r, [--ruby=PATH] # Path to the Ruby binary of your choice
# Default: /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/bin/ruby
-G, [--skip-git] # Skip Git ignores and keeps
-b, [--builder=BUILDER] # Path to an application builder (can be a filesystem path or URL)
[--edge] # Setup the application with Gemfile pointing to Rails repository
Runtime options:
-f, [--force] # Overwrite files that already exist
-s, [--skip] # Skip files that already exist
-p, [--pretend] # Run but do not make any changes
-q, [--quiet] # Supress status output
Rails options:
-h, [--help] # Show this help message and quit
-v, [--version] # Show Rails version number and quit
Description:
The 'rails new' command creates a new Rails application with a default
directory structure and configuration at the path you specify.
Example:
rails new ~/Code/Ruby/weblog
This generates a skeletal Rails installation in ~/Code/Ruby/weblog.
See the README in the newly created application to get going.
您正在错误的目录中运行
rails服务器
。进入包含应用程序的目录,然后从那里运行命令。例如,如果您运行了rails new thingy
,那么当您使用rails服务器时,您必须在thingy
目录下我也是在从rails 2升级到rails 3时得到的。然后我运行了railsnew.
来替换所有必要的文件,之后它就工作了。其他问题可能是:
您必须已从根目录或其中的某些文件中删除了bin文件夹。请将其恢复,所有操作都将正常工作。您的文件夹管理器应位于Gemfile中
通常,如果您克隆存储库或使用Docker,则像.gitignore
或这样的文件。dockerignore
有不包含bin文件夹的说明,请检入这两个文件并简单地删除其中的行
您可以在另一个目录中执行rails new
,将生成的bin文件夹复制到您的项目中,然后推送到您的存储库。我收到了相同的错误,并且我也在正确的目录中。还有什么其他原因可能导致这种情况吗?如果您尝试运行rails c
,会发生什么情况?你的应用程序名是什么,你从哪个目录运行服务器命令?嘿,大卫,我解决了。我必须运行script/server并安装iconv。