Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
694 views
in Technique[技术] by (71.8m points)

ruby on rails - heroku run console returns 'Error connecting to process'

I have deployed a rails 3.1 app to Heroku Cedar stack, and am trying to perform a:

heroku run rake db:migrate

it returns:

Running console attached to terminal... 
Error connecting to process

I also try to simply launch the console:

heroku run console

Any run command returns the same error.

Running console attached to terminal... 
Error connecting to process

Looking at the logs I get the error code:

2011-09-25T16:04:52+00:00 app[run.2]: Error R13 (Attach error) -> Failed to attach to process

When I heroku ps to see the current processes, I can see my attempts are running:

Process       State               Command
------------  ------------------  ------------------------------
run.2         complete for 26m    bundle exec rails console
run.3         up for 27s          bundle exec rails console
run.4         up for 3s           bundle exec rake db:create
web.1         up for 46s          bundle exec thin start -p $PORT -e..

But again each of them are raising exceptions:

2011-09-25T16:31:47+00:00 app[run.3]: Error R13 (Attach error) -> Failed to attach to process
2011-09-25T16:31:47+00:00 heroku[run.3]: Process exited
2011-09-25T16:31:48+00:00 heroku[run.3]: State changed from up to complete
2011-09-25T16:32:11+00:00 app[run.4]: Error R13 (Attach error) -> Failed to attach to process
2011-09-25T16:32:11+00:00 heroku[run.4]: Process exited
2011-09-25T16:32:12+00:00 heroku[run.4]: State changed from up to complete

Server Admin isnt my cup of tea, hence the decision to use Heroku.

Both Heroku docs and Googling have not led me down a path that give me much to go on.

Any ideas? This has not been my experience on the Bamboo stack.

My other errors are obviously related to DB migrations not being performed. Until I can run the rake tasks, I'm stuck moving forward.

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

I had the same problem, and although I did not solve the problem, I found a workaround.

Instead of using:

heroku run rake db:migrate

You can use:

heroku run:detached rake db:migrate

This runs the command in the background, writing the output to the log. When it is finished you can view the log for the result.

Not ideal, but when you are on an inadequate network, it will get you out of a hole :)


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...