rails console doesn't start

24,567

Solution 1

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.

Solution 2

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.

Solution 3

Running spring stop did the trick for me.

Solution 4

In my case, the same trouble is occured on my production environment.

If your environmet is also production, in the first place, you must not install spring on your production environment.

refer this https://github.com/rails/spring/issues/318 https://github.com/rails/spring/pull/337/files

It can be resolved by this command on your production

RAILS_ENV=production bundle install --clean --without development test

Solution 5

I could run rails console again in Rails 5.2.1 with:

  • bundle clean --force
  • bundle install --without development test

Note: My RAILS_ENV variable is already set to production.

Share:
24,567
JonatasTeixeira
Author by

JonatasTeixeira

Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum. Aliquam ut porttitor leo a diam sollicitudin tempor id. Consectetur a erat nam at lectus urna duis. Sed faucibus turpis in eu mi bibendum. Vitae elementum curabitur vitae nunc sed. Erat nam at lectus urna duis. Sed lectus vestibulum mattis ullamcorper velit sed ullamcorper morbi. Aliquam etiam erat velit scelerisque. Tincidunt ornare massa eget egestas. Tincidunt eget nullam non nisi est sit amet facilisis magna. Viverra ipsum nunc aliquet bibendum enim facilisis. Ipsum dolor sit amet consectetur adipiscing elit. Lectus mauris ultrices eros in cursus. Rhoncus mattis rhoncus urna neque viverra justo. Tortor at risus viverra adipiscing. Posuere morbi leo urna molestie at elementum eu facilisis. Justo eget magna fermentum iaculis eu non. Vitae tortor condimentum lacinia quis vel eros donec ac odio. Dui vivamus arcu felis bibendum.

Updated on July 08, 2022

Comments

  • JonatasTeixeira
    JonatasTeixeira almost 2 years

    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..