我正在使用 rails 4.2,ruby 2.3,puma 3.4,nginx ,并尝试在 GCP计算引擎实例上部署Rails应用。当我通过ssh在gcp实例上启动Rails服务器时,服务器开始运行,但是在浏览器上我无法在任何端口上访问该应用程序。我在这里尝试了所有答案,但没有帮助。
服务器日志-
$ rails s -b 0.0.0.0
Array values in the parameter to `Gem.paths=` are deprecated.
Please use a String or nil.
An Array ({"GEM_PATH"=>["/home/sujeet/.rvm/gems/ruby-2.2.4", "/home/sujeet/.rvm/gems/ruby-2.2.4@global"]}) was passed in from bin/rails:3:in `load'
=> Booting Puma
=> Rails 4.2.1 application starting in development on http://0.0.0.0:3000
=> Run `rails server -h` for more startup options
=> Ctrl-C to shutdown server
Rails Error: Unable to access log file. Please ensure that /home/sujeet/furdo/log/development.log exists and is writable (ie, make it writable for user and group: chmod 0664 /home/sujeet/furdo/log/development.log). The log level has been raised to WARN and the output directed to STDERR until the problem is fixed.
The PGconn, PGresult, and PGError constants are deprecated, and will be
removed as of version 1.0.
You should use PG::Connection, PG::Result, and PG::Error instead, respectively.
Called from /home/sujeet/.rvm/gems/ruby-2.2.4/gems/activerecord-4.2.1/lib/active_record/connection_adapters/postgresql_adapter.rb:44:in `new'
Spree::Taxonomy Load (0.8ms) SELECT "spree_taxonomies".* FROM "spree_taxonomies" WHERE "spree_taxonomies"."name" = $1 ORDER BY spree_taxonomies.position, spree_taxonomies.created_at LIMIT 1 [["name", "Product Categories"]]
Spree::Taxonomy Load (0.4ms) SELECT "spree_taxonomies".* FROM "spree_taxonomies" WHERE "spree_taxonomies"."name" = $1 ORDER BY spree_taxonomies.position, spree_taxonomies.created_at LIMIT 1 [["name", "Vendors"]]
Spree::Taxonomy Load (0.2ms) SELECT "spree_taxonomies".* FROM "spree_taxonomies" WHERE "spree_taxonomies"."name" = $1 ORDER BY spree_taxonomies.position, spree_taxonomies.created_at LIMIT 1 [["name", "Package"]]
(0.7ms) SELECT "spree_taxons"."id" FROM "spree_taxons" WHERE "spree_taxons"."taxonomy_id" IS NULL AND ("spree_taxons"."parent_id" IS NOT NULL)
(0.3ms) SELECT "spree_taxons"."id" FROM "spree_taxons" WHERE "spree_taxons"."taxonomy_id" IS NULL AND ("spree_taxons"."parent_id" IS NOT NULL)
Spree::Property Load (0.3ms) SELECT "spree_properties".* FROM "spree_properties" WHERE "spree_properties"."name" = $1 LIMIT 1 [["name", "vendor_link"]]
Spree::Property Load (0.2ms) SELECT "spree_properties".* FROM "spree_properties" WHERE "spree_properties"."name" = $1 LIMIT 1 [["name", "stock"]]
Spree::Property Load (0.2ms) SELECT "spree_properties".* FROM "spree_properties" WHERE "spree_properties"."name" = $1 LIMIT 1 [["name", "3d_modeled"]]
Spree::Property Load (0.2ms) SELECT "spree_properties".* FROM "spree_properties" WHERE "spree_properties"."name" = $1 LIMIT 1 [["name", "theme_designer"]]
Spree::OptionType Load (0.4ms) SELECT "spree_option_types".* FROM "spree_option_types" WHERE "spree_option_types"."name" = $1 ORDER BY spree_option_types.position LIMIT 1 [["name", "Focus"]]
Spree::AuthenticationMethod Load (0.3ms) SELECT "spree_authentication_methods".* FROM "spree_authentication_methods" WHERE "spree_authentication_methods"."environment" = $1 [["environment", "development"]]
Spree::AuthenticationMethod Load (0.2ms) SELECT "spree_authentication_methods".* FROM "spree_authentication_methods" WHERE "spree_authentication_methods"."environment" = $1 [["environment", "development"]]
Spree::AuthenticationMethod Load (0.3ms) SELECT "spree_authentication_methods".* FROM "spree_authentication_methods" WHERE "spree_authentication_methods"."environment" = $1 [["environment", "development"]]
Spree::AuthenticationMethod Load (0.2ms) SELECT "spree_authentication_methods".* FROM "spree_authentication_methods" WHERE "spree_authentication_methods"."environment" = $1 [["environment", "development"]]
Spree::AuthenticationMethod Load (0.2ms) SELECT "spree_authentication_methods".* FROM "spree_authentication_methods" WHERE "spree_authentication_methods"."environment" = $1 [["environment", "development"]]
DEPRECATION WARNING: Devise.allow_insecure_token_lookup= is deprecated and has no effect. (called from allow_insecure_token_lookup= at (eval):6)
Spree::Preference Load (0.4ms) SELECT "spree_preferences".* FROM "spree_preferences" WHERE "spree_preferences"."key" = $1 ORDER BY "spree_preferences"."id" ASC LIMIT 1 [["key", "spree/auth_configuration/confirmable"]]
(0.2ms) BEGIN
Spree::Preference Exists (0.6ms) SELECT 1 AS one FROM "spree_preferences" WHERE ("spree_preferences"."key" = 'spree/auth_configuration/confirmable' AND "spree_preferences"."id" != 1) LIMIT 1
(0.2ms) COMMIT
Spree::Preference Load (0.3ms) SELECT "spree_preferences".* FROM "spree_preferences" WHERE "spree_preferences"."key" = $1 ORDER BY "spree_preferences"."id" ASC LIMIT 1 [["key", "spree/app_configuration/default_country_id"]]
(0.1ms) BEGIN
Spree::Preference Exists (0.3ms) SELECT 1 AS one FROM "spree_preferences" WHERE ("spree_preferences"."key" = 'spree/app_configuration/default_country_id' AND "spree_preferences"."id" != 2) LIMIT 1
(0.1ms) COMMIT
Spree::Preference Load (0.3ms) SELECT "spree_preferences".* FROM "spree_preferences" WHERE "spree_preferences"."key" = $1 ORDER BY "spree_preferences"."id" ASC LIMIT 1 [["key", "spree/app_configuration/always_include_confirm_step"]]
(0.3ms) BEGIN
Spree::Preference Exists (0.3ms) SELECT 1 AS one FROM "spree_preferences" WHERE ("spree_preferences"."key" = 'spree/app_configuration/always_include_confirm_step' AND "spree_preferences"."id" != 3) LIMIT 1
(0.1ms) COMMIT
Spree::Preference Load (0.3ms) SELECT "spree_preferences".* FROM "spree_preferences" WHERE "spree_preferences"."key" = $1 ORDER BY "spree_preferences"."id" ASC LIMIT 1 [["key", "spree/app_configuration/check_for_spree_alerts"]]
(0.1ms) BEGIN
Spree::Preference Exists (0.3ms) SELECT 1 AS one FROM "spree_preferences" WHERE ("spree_preferences"."key" = 'spree/app_configuration/check_for_spree_alerts' AND "spree_preferences"."id" != 4) LIMIT 1
(0.1ms) COMMIT
Spree::Preference Load (0.3ms) SELECT "spree_preferences".* FROM "spree_preferences" WHERE "spree_preferences"."key" = $1 ORDER BY "spree_preferences"."id" ASC LIMIT 1 [["key", "spree/social_configuration/path_prefix"]]
(0.1ms) BEGIN
Spree::Preference Exists (0.3ms) SELECT 1 AS one FROM "spree_preferences" WHERE ("spree_preferences"."key" = 'spree/social_configuration/path_prefix' AND "spree_preferences"."id" != 5) LIMIT 1
(0.1ms) COMMIT
Puma starting in single mode...
* Version 3.4.0 (ruby 2.2.4-p230), codename: Owl Bowl Brawl
* Min threads: 1, max threads: 6
* Environment: development
* Listening on tcp://0.0.0.0:3000
* Starting control server on unix:///tmp/puma-status-1548153185501-23281
Use Ctrl-C to stop*
答案 0 :(得分:0)
您是否确定允许通过您应用程序发布端口的流量?这是创建Firewall Rule in GCP的文档,在防火墙规则中,您应该添加应用程序使用的端口。另外,请确保您的本地防火墙没有阻止该应用程序。