Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

rails console doesn't start

I`m in root of my application, and when I type

$ rails console 

It looks like something is loading, but nothing happens.

And when I stop ^C I received this trace:

^C/home/jonatas/.rvm/gems/ruby-2.1.2/gems/spring-1.1.3/lib/spring/client/run.rb:54:in `gets': Interrupt from /home/jonatas/.rvm/gems/ruby-2.1.2/gems/spring-1.1.3/lib/spring/client/run.rb:54:in `verify_server_version' from /home/jonatas/.rvm/gems/ruby-2.1.2/gems/spring-1.1.3/lib/spring/client/run.rb:25:in `call' from /home/jonatas/.rvm/gems/ruby-2.1.2/gems/spring-1.1.3/lib/spring/client/command.rb:7:in `call' from /home/jonatas/.rvm/gems/ruby-2.1.2/gems/spring-1.1.3/lib/spring/client/rails.rb:23:in `call' from /home/jonatas/.rvm/gems/ruby-2.1.2/gems/spring-1.1.3/lib/spring/client/command.rb:7:in `call' from /home/jonatas/.rvm/gems/ruby-2.1.2/gems/spring-1.1.3/lib/spring/client.rb:26:in `run' from /home/jonatas/.rvm/gems/ruby-2.1.2/gems/spring-1.1.3/bin/spring:48:in `<top (required)>' from /home/jonatas/.rvm/gems/ruby-2.1.2/gems/spring-1.1.3/lib/spring/binstub.rb:11:in `load' from /home/jonatas/.rvm/gems/ruby-2.1.2/gems/spring-1.1.3/lib/spring/binstub.rb:11:in `<top (required)>' from /home/jonatas/.rvm/rubies/ruby-2.1.2/lib/ruby/2.1.0/rubygems/core_ext/kernel_require.rb:55:in `require' from /home/jonatas/.rvm/rubies/ruby-2.1.2/lib/ruby/2.1.0/rubygems/core_ext/kernel_require.rb:55:in `require' from /home/jonatas/Code/Ruby/jonatasteixeira/bin/spring:16:in `<top (required)>' from bin/rails:3:in `load' from bin/rails:3:in `<main>' 

I have no idea whats going on..

like image 499
JonatasTeixeira Avatar asked Jun 18 '14 02:06

JonatasTeixeira


People also ask

How do I start rails console?

Go to your browser and open http://localhost:3000, you will see a basic Rails app running. You can also use the alias "s" to start the server: bin/rails s . The server can be run on a different port using the -p option. The default development environment can be changed using -e .

How do I run a Ruby script in rails console?

RubyMine allows you to run source code from the editor in the Rails console. To do this, perform the following steps: Open the required Ruby file in the editor (if necessary, select a fragment of code to be executed). From the main menu, choose Tools | Load file/selection into IRB/Rails console.


2 Answers

I may be answering a bit late for this, but for the sake of the others who are looking for the answer... it's here

Basically, enter this command

spring stop 

The issue , as far as I understand, is with the spring gem, specifically, it checks the server for versions, which doesn't tally up.

For my case, the problem started when when I add some new gems into the gemfile.

So once you stop spring and type in any other rails command, spring restart, and every thing should work again, at least until the same problem occurs, or the dev patched the issue.

like image 71
On a Railsroad Avatar answered Sep 19 '22 12:09

On a Railsroad


I've not seen this before, but it looks like maybe spring is messed up in your setup for some reason? Try going into your Gemfile and look for the line that calls gem 'spring' and comment that out. Then run bundle install and try again.

This isn't a proper solution, but if it gets your rails console working again tonight then hopefully it will help you out until a proper solution is discovered.

like image 44
bratsche Avatar answered Sep 22 '22 12:09

bratsche