Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rails console is not interactive #482

Closed
alxx opened this issue Nov 17, 2016 · 2 comments
Closed

Rails console is not interactive #482

alxx opened this issue Nov 17, 2016 · 2 comments

Comments

@alxx
Copy link

alxx commented Nov 17, 2016

Hi there,

When trying to open a remote console, the terminal hangs:

$ mina server:console -f config/deploy_production.rb
-----> Loading rbenv
       Running via Spring preloader in process 29824
       Loading production environment (Rails 5.0.0.beta3)

Looking at the processes from a separate SSH console shows that the console is actually running:

$ ps aux | grep 'console production'
ubuntu   29792  1.2  0.2  93036 21560 pts/6    Sl+  09:12   0:00 /home/ubuntu/.rbenv/versions/2.2.3/bin/ruby bin/rails console production

But I don't see the console prompt. Unlike the old 'queue', the new 'command' doesn't seem to allow for interaction.

If I terminate mina with Ctrl-C:

^C
-----> Mina: SIGINT received.
       Killed by signal 2.

       irb(main):001:0> 
 !     Run Error

The console seems to have been waiting for input, but none was passed to it.

The relevant section in config/deploy_production.rb:

namespace :server do
  desc 'Run Rails console'

  task :console do
    invoke :'rbenv:load'
    
    in_path "#{fetch(:current_path)}" do
      command %{#{fetch(:rails)} console production}
    end
  end
end

Any suggestions?

@d4be4st
Copy link
Member

d4be4st commented Nov 17, 2016

There is already a console task for rails you can use:

mina console

But if you set set :execution_mode, :exec you should be able to interact with your task

@alxx
Copy link
Author

alxx commented Nov 17, 2016

Thank you. That worked.

@alxx alxx closed this as completed Nov 17, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants