无法在 rails ubuntu 上访问 localhost:3000 ruby
Can not acces localhost:3000 ruby on rails ubuntu
我一直在尝试通过 运行 命令 rails s
或 rails server
访问或至少在我的 Rails 中显示我的服务器,但它不起作用:
起初它告诉我我必须安装新的 gems 和 运行 命令 bundle install
来升级它们,我做到了。它安装了所有东西 "correctly"。
现在,我只是得到一些使用帮助而不是 Rails(例如我可以使用的命令)。我以为 Rails 已经出来了,但我 运行 命令 rails new myApp
它确实为我创建了一个并且捆绑包安装正常。我只想启动我的应用程序并尝试 localhost:port
,然后打开我的应用程序。
当我尝试生成某些东西时,它会发生同样的情况,例如 rails g model OneModel
(或 generate
而不是 g
)以及我想要生成的任何东西。它似乎不理解我的命令。
我是 ubuntu 的新手,并且远远超过 Rails 和 ruby 的新手。如果你能帮助我,我会很高兴。这是我得到的输出:
agustin@agustin:~/Agustin/myapp$ rails s
Usage:
rails new APP_PATH [options]
Options:
-r, [--ruby=PATH] # Path to the Ruby binary of your choice
# Default: /usr/bin/ruby
-b, [--builder=BUILDER] # Path to a application builder (can be a filesystem path or URL)
-m, [--template=TEMPLATE] # Path to an application template (can be a filesystem path or URL)
[--skip-gemfile] # Don't create a Gemfile
[--skip-bundle] # Don't run bundle install
-G, [--skip-git] # Skip Git ignores and keeps
-O, [--skip-active-record] # Skip Active Record files
-S, [--skip-sprockets] # Skip Sprockets files
-d, [--database=DATABASE] # Preconfigure for selected database (options: mysql/oracle/postgresql/sqlite3/frontbase/ibm_db/sqlserver/jdbcmysql/jdbcsqlite3/jdbcpostgresql/jdbc)
# Default: sqlite3
-j, [--javascript=JAVASCRIPT] # Preconfigure for selected JavaScript library
# Default: jquery
-J, [--skip-javascript] # Skip JavaScript files
[--dev] # Setup the application with Gemfile pointing to your Rails checkout
[--edge] # Setup the application with Gemfile pointing to Rails repository
-T, [--skip-test-unit] # Skip Test::Unit files
[--old-style-hash] # Force using old style hash (:foo => 'bar') on Ruby >= 1.9
Runtime options:
-f, [--force] # Overwrite files that already exist
-p, [--pretend] # Run but do not make any changes
-q, [--quiet] # Suppress status output
-s, [--skip] # Skip files that already exist
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.
You can specify extra command-line arguments to be used every time
'rails new' runs in the .railsrc configuration file in your home directory.
Note that the arguments specified in the .railsrc file don't affect the
defaults values shown above in this help message.
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.
agustin@agustin:~/Agustin/myapp$
您必须从项目根目录运行 rails s
。
例如,如果您创建一个 rails 应用程序,比如 rails new my_app
,它将在当前目录中创建一个框架应用程序 my_app
。现在您必须 cd
到该目录才能启动服务器
我一直在尝试通过 运行 命令 rails s
或 rails server
访问或至少在我的 Rails 中显示我的服务器,但它不起作用:
起初它告诉我我必须安装新的 gems 和 运行 命令 bundle install
来升级它们,我做到了。它安装了所有东西 "correctly"。
现在,我只是得到一些使用帮助而不是 Rails(例如我可以使用的命令)。我以为 Rails 已经出来了,但我 运行 命令 rails new myApp
它确实为我创建了一个并且捆绑包安装正常。我只想启动我的应用程序并尝试 localhost:port
,然后打开我的应用程序。
当我尝试生成某些东西时,它会发生同样的情况,例如 rails g model OneModel
(或 generate
而不是 g
)以及我想要生成的任何东西。它似乎不理解我的命令。
我是 ubuntu 的新手,并且远远超过 Rails 和 ruby 的新手。如果你能帮助我,我会很高兴。这是我得到的输出:
agustin@agustin:~/Agustin/myapp$ rails s
Usage:
rails new APP_PATH [options]
Options:
-r, [--ruby=PATH] # Path to the Ruby binary of your choice
# Default: /usr/bin/ruby
-b, [--builder=BUILDER] # Path to a application builder (can be a filesystem path or URL)
-m, [--template=TEMPLATE] # Path to an application template (can be a filesystem path or URL)
[--skip-gemfile] # Don't create a Gemfile
[--skip-bundle] # Don't run bundle install
-G, [--skip-git] # Skip Git ignores and keeps
-O, [--skip-active-record] # Skip Active Record files
-S, [--skip-sprockets] # Skip Sprockets files
-d, [--database=DATABASE] # Preconfigure for selected database (options: mysql/oracle/postgresql/sqlite3/frontbase/ibm_db/sqlserver/jdbcmysql/jdbcsqlite3/jdbcpostgresql/jdbc)
# Default: sqlite3
-j, [--javascript=JAVASCRIPT] # Preconfigure for selected JavaScript library
# Default: jquery
-J, [--skip-javascript] # Skip JavaScript files
[--dev] # Setup the application with Gemfile pointing to your Rails checkout
[--edge] # Setup the application with Gemfile pointing to Rails repository
-T, [--skip-test-unit] # Skip Test::Unit files
[--old-style-hash] # Force using old style hash (:foo => 'bar') on Ruby >= 1.9
Runtime options:
-f, [--force] # Overwrite files that already exist
-p, [--pretend] # Run but do not make any changes
-q, [--quiet] # Suppress status output
-s, [--skip] # Skip files that already exist
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.
You can specify extra command-line arguments to be used every time
'rails new' runs in the .railsrc configuration file in your home directory.
Note that the arguments specified in the .railsrc file don't affect the
defaults values shown above in this help message.
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.
agustin@agustin:~/Agustin/myapp$
您必须从项目根目录运行 rails s
。
例如,如果您创建一个 rails 应用程序,比如 rails new my_app
,它将在当前目录中创建一个框架应用程序 my_app
。现在您必须 cd
到该目录才能启动服务器