如何将远程服务器上的rails应用程序引导到开发中?

时间:2022-05-18 20:54:26

I totally apologize for being so naiive. But when I deploy to production, it is automatically boots up in production mode.

我很抱歉这么天真。但当我部署到生产模式时,它会自动启动到生产模式。

How do I alternatively boot this up in development mode?

我如何在开发模式中启动它?

1 个解决方案

#1


3  

Depends on what you are using to run your Rails application.

这取决于您使用什么来运行Rails应用程序。

  • If you are using Passenger for Apache, set RailsEnv to development in your vhost, then restart the web server. For Passenger on Nginx check here: http://www.modrails.com/documentation/Users%20guide%20Nginx.html#_ruby_on_rails_specific_options
  • 如果您使用的是Apache的乘客,请将RailsEnv设置为您的vhost中的开发,然后重新启动web服务器。对于Nginx的乘客,请在这里查看:http://www.modrails.com/documentation/users%20nginx.html # _ruby_on_rails__options。
  • If you are using mongrel or thin, it has an option for that. Check their docs
  • 如果您使用的是混色或单色,可以选择。检查他们的文档
  • If you are using script/server pass it as an argument: script/server development
  • 如果您正在使用脚本/服务器作为参数传递它:脚本/服务器开发
  • Or if you are using rails server (for rails 3): rails server -e development
  • 或者如果您正在使用rails服务器(对于rails 3): rails服务器-e开发

Often you can also set the environment variable RAILS_ENV to do this as well, for example: RAILS_ENV=development rails server

通常,您还可以设置环境变量RAILS_ENV来实现这一点,例如:RAILS_ENV=development rails服务器

#1


3  

Depends on what you are using to run your Rails application.

这取决于您使用什么来运行Rails应用程序。

  • If you are using Passenger for Apache, set RailsEnv to development in your vhost, then restart the web server. For Passenger on Nginx check here: http://www.modrails.com/documentation/Users%20guide%20Nginx.html#_ruby_on_rails_specific_options
  • 如果您使用的是Apache的乘客,请将RailsEnv设置为您的vhost中的开发,然后重新启动web服务器。对于Nginx的乘客,请在这里查看:http://www.modrails.com/documentation/users%20nginx.html # _ruby_on_rails__options。
  • If you are using mongrel or thin, it has an option for that. Check their docs
  • 如果您使用的是混色或单色,可以选择。检查他们的文档
  • If you are using script/server pass it as an argument: script/server development
  • 如果您正在使用脚本/服务器作为参数传递它:脚本/服务器开发
  • Or if you are using rails server (for rails 3): rails server -e development
  • 或者如果您正在使用rails服务器(对于rails 3): rails服务器-e开发

Often you can also set the environment variable RAILS_ENV to do this as well, for example: RAILS_ENV=development rails server

通常,您还可以设置环境变量RAILS_ENV来实现这一点,例如:RAILS_ENV=development rails服务器