Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Trouble starting Ruby console

I am fairly new to Ruby. I am have a problem getting my console to start a second time. I created my app (JacksApp) and created a model for it. I then shut down the app tried to restart the console a second time. When I type "rails c" I get this:

Running via Spring preloader in process 81129 Loading development environment (Rails 5.0.0.1) No entry for terminal type "1.0.0/libexec:/Users/johnseabolt/.rbenv/shims:/Library/Frameworks/Python.framework/Versions/3.5/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin"; using dumb terminal settings. irb(main):001:0>

I don't understand what's going on. Can someone help? I am in the directory for the app. I'm confused.

like image 598
J Seabolt Avatar asked Sep 20 '25 01:09

J Seabolt


2 Answers

to fix this, you need to stop all rails processes and stop spring (bin/spring stop) and then make sure that you start up spring with an attached terminal.

There are basically three ways where spring would get started: bundle exec rails server, bundle exec rails console, or something like bundle exec guard or some other testing thing. If you start up rails through foreman, then it will run one of these commands, basically.

Starting the console will attach a input to the process, and this is where it will figure out the "terminal" type. Do that first, before everything thing else. Once that's loaded in memory, then its configured correctly, and starting up server or whatever will work find.

Server then console will give you the crazy error that you see. console then server will not.

like image 66
Will Schenk Avatar answered Sep 22 '25 04:09

Will Schenk


On MacOS Sierra, check TERM in Terminal.app

$ echo $TERM
xterm-256color
$ bin/spring stop
$ bin/rails c
No entry for terminal type "local/var/ry/rubies";
using dumb terminal settings.
irb> exit
$ bin/rails c
Cannot read termcap database;
using dumb terminal settings.

You can change TERM via Terminal > Preference > Profiles > Advanced > Terminfo > Declare terminal as: xterm.

Open new Terminal.

$ echo $TERM
xterm
$ bin/rails c
irb>    

All sweet no warnings.

Now I leave it to someone with greater knowledge to explain why.

like image 45
Khoa Nguyen Avatar answered Sep 22 '25 03:09

Khoa Nguyen