My rails console showing garbage output after I enter any wrong command - ruby-on-rails

If I type any wrong command, then my rails console is going crazy and taking random command and showing that commands output, instead of showing the exact one. But if I reopen it, then it works fine. So every time I have to reopen the console and retype from the beginning.
for example: If I type any wrong command and in the next try, if I type up key then it is showing " [ ", instead of showing previous command.
Sometimes it may happen that, if I type backspace then it deletes everything on the screen(i.e. Desktop/User> this too).
Is there any solution??

Tried many things, but finally updated rails(temporary fix). Worked fine.
Answering this after many days, as the other people who will come across this will get idea about temporary fix.

Related

Getting message about docker wanting to create symlink every time I start Mac

(Almost) every time I start up my Mac, I get the the following message:
Docker Desktop wants to create /var/run/docker.sock symlink. Touch ID or enter your password to allow this.
Anybody knows how to get rid of this?
I allow it every time, but it keeps popping up every time I start up the Mac nonetheless.
There is an issue open: Docker asks to create a symlink after every OS restart. #6634
Response is "should be fixed in the next release". The workaround of editing ~/Library/Group\ Containers/group.com.docker/settings.json and setting "authDeclinedInstallSettings": false, to true worked for me.
Yeah i really advise not to use the suggested "workaround" above concerning "authDeclinedInstallSettings"
While everything seem to work normal at a first glance,
i ended up this morning not beeing to able to build spring native images any more.
Because of the builder complaining that in cannot open the socket / connection any more.
At first I was totally puzzled, until backtracking that i did this change a couple of days ago.
Reverted it and now everything is back to normal .. of course that the nagging prompt is back

tqdm prints an empty bar after loop ends

tqdm prints an empty bar after loop ends. I tried implementing this solution, but with no success.
The problem does not exist if I remove the print statement (see code).
My code is:
for PhotoIdx in tqdm(range(Nphotos), position=0, leave=True):
....
end
print("something")
return x
I attach a photo with what is outputted to the terminal (the third bar is from another python file).
This appears to be a Pycharm issue, which can be fixed by editing the Run/Debug Configuration in Pycharm and checking the box that says "Emulate terminal in output console"
The standard output terminal appears to have trouble with properly outputting text applications that use certain terminal features, although I don't know the exact cause of this particular problem.
it seems to be a bug from Pycharm.
It's working fine inside the terminal.
Have a good day

Command line won't let me type, in the midst of a Rails Console session

In Rails console I entered an Active Record query, and it took up more than the whole screen, so it was scrolling. I forgot to hit q to get out of it and instead hit Ctrl-C. I got some errors, then I got some of the Rails console output, then I hit ^C again, then my prompt came up...
But I can't type anything. Well, actually I can type, but I can't see anything.
If I type exit it will exit the Rails console and get me back to my prompt, and then if I type rails c I'll get back to my console. Except none of the things I just mentioned typing appear on the screen when I type them.
And once I'm back inside the console I still can't see what I'm typing. I have to open a new terminal.
I've had this happen in a number of different scenarios, probably all where my reflexes exited a process the wrong way (like with ^C instead of q), and this is just the first one where I could pin it down.
Does anyone know how to fix this without having to scrap my work and open a new terminal?
Something you've typed, or something output from your query in console, has disabled or redirected the "echo" setting in your shell - so, you're still able to type commands, but you just can't see them. If the Active Record query returned binary data, it's quite likely that some bytes of the binary data happened to be an escape code that changed your echo setting. It's also important to realize that if your echo setting changed, it's quite possible that other settings have changed as well.
If you're at your shell prompt, you would just type the unix command reset to restore normal settings. However, if you're still in your Rails console, you'll need to type:
system 'reset'
to run that command from Ruby.
Type reset and press enter, it should be fixed.

How to display error occurred in script?

I think my question is already asked, but I didn't find any topic about that.
When I try somme script with kivy, I have sometimes errors (such as undeclared variable, bad indentation...), but Qpython don't display them.
I lunch kivy with:
"#qpy:kivy"
and consequently, there is no console. A log is however present, but it's empty.
Is there a way to remedy this ?
Should I add a line to display error ?
Thanks
Simon
PS: The "print" command is also useful, but not working (no console). I think it's the same problem.
The newest 1.2.0 version had fixed this blank log issue.

Breaking on exception: Strict get failed, invalid object. (dart)

I wasn't able to find anything helpful through google, so:
My Dart webapplication worked perfectly. Next time I opened Darteditor and (without changing anything) ran it again, Darteditor showed the Error
Breaking on exception: Strict get failed, invalid object.
This Error doesn't always show up and even when it does, the App still functions. Darteditor doesn't give me any hit where that Error occurs, because the debugger claims some source not to be available.
Does anyone know why/when this Error occurrs and what to do to fix it?
EDIT 1:
As suggested in comments:
updating Darteditor
pub cache repair
pub upgrade
Did not work
EDIT 2:
A Day after I tried the things mentioned in EDIT 1. Thus also after I rebooted the PC. At the moment, the Error doesn't appear anymore. I tried restarting the Darteditor after each try in EDIT 1 but nothing changed. Now...some of the things in EDIT 1 seem to have taken effect only after rebooting the PC. Not sure which of those though - am I supposed to answer my own question mentioning all 3 options from EDIT 1 or what should I do?
EDIT 3:
(Sorry for all the edits)
I changed some code now and the Error is back here again...
Sometimes it goes away, but not with a obvious reason like a specific line of code added/removed. Right now, ther is an additional line by the Error:
Application Cache NoUpdate event (https://www.google.ch/xjs/_/js/k=xjs.ntp.en_US.mqcA3JMW-QU.O/m=jsa,ntp,pcc,csi/rt=j/d=1/t=zcms/rs=AItRSTO3mHFV3hPPmf2KYlzqp_GC2s-5GQ:119)
Breaking on exception: Strict get failed, invalid object.
I get the same error message when I click the back button in Dartium,
or when I use the backspace key and the focus is not in an editable
field (which triggers the back button). I think it's either a bug in
Dart or Dartium. – Damien Aug 21 at 14:00
Interesting: When I pressed the back button in dartium, the error did
show up, but after this, it said something about application cache
(about 5 lines of text) and now I cannot reproduce the "strict get
failed" Error message – lucidbrot yesterday
pressing the back button in dartium, which I never did before, seemed to help in my case. Updating Darteditor again after this didn't change anything - the strict get error disappeared.
I won't accept this answer until somebody comments that it worked for him too, but I guess it is better to view here than as a comment to my question.

Resources