Ruby on rails Capistrano导轨:控制台

Ruby on rails Capistrano导轨:控制台,ruby-on-rails,ruby,console,capistrano,Ruby On Rails,Ruby,Console,Capistrano,我的服务器通过Capistrano部署 我需要在远程服务器上进入rails控制台。我知道一种可能的方法是GEM,称为capistrano控制台,您需要做的就是在本地机器上键入bundle exec cap production rails:console,它确实开始连接到远程服务器,但它开始使用错误的用户名连接 我的意思是在bundle exec cap production rails:console启动后: my_local_user_name@server_ip 但我需要它来做: my_

我的服务器通过Capistrano部署

我需要在远程服务器上进入rails控制台。我知道一种可能的方法是GEM,称为
capistrano控制台
,您需要做的就是在本地机器上键入
bundle exec cap production rails:console
,它确实开始连接到远程服务器,但它开始使用错误的用户名连接

我的意思是在
bundle exec cap production rails:console
启动后:

my_local_user_name@server_ip
但我需要它来做:

my_remote_server_user_name@server_ip

有人能告诉你为什么会这样吗?

你可以将远程用户名设置为角色

role :app, "my_remote_server_user_name@server_ip"

并在您的命令中使用该角色(发布时的角色:app),或者如果您在发布时使用将自动使用该角色:all

您可以将远程用户名设置为角色

role :app, "my_remote_server_user_name@server_ip"
并在命令中使用该角色(发布时角色:app),或者如果在发布时使用角色:all