0
{9:08}~/dev/rails ➭ which ruby
/Users/jay/.rubies/ruby-2.7.1/bin/ruby
{9:08}~/dev/rails ➭ which rails
/Users/jay/.gem/ruby/2.7.1/bin/rails
{9:08}~/dev/rails ➭ rails -v
Rails 6.0.3.2
{9:08}~/dev/rails ➭ rails new one
      create  
      create  README.md
      create  Rakefile

*********************************************************************
********** lots of instal messages, no errors reported **************
*********************************************************************

✨  Done in 4.74s.
Webpacker successfully installed  
{9:09}~/dev/rails ➭ cd one
{9:09}~/dev/rails/one:master ✗ ➭ ruby -v
ruby 2.7.1p83 (2020-03-31 revision a0c7c23c9c) [x86_64-darwin19]
{9:09}~/dev/rails/one:master ✗ ➭ which ruby
/Users/jay/.rubies/ruby-2.7.1/bin/ruby
{9:09}~/dev/rails/one:master ✗ ➭ which bundler
/Users/jay/.rubies/ruby-2.7.1/bin/bundler
{9:10}~/dev/rails/one:master ✗ ➭ bundle exec rails s
=> Booting Puma
=> Rails 6.0.3.2 application starting in development 
=> Run `rails server --help` for more startup options
Exiting
Traceback (most recent call last):
    80: from bin/rails:3:in `<main>'
    79: from bin/rails:3:in `load'
    78: from /Users/jay/Dev/rails/one/bin/spring:15:in `<top (required)>'
    77: from /Users/jay/Dev/rails/one/bin/spring:15:in `require'
    76: from /Users/jay/.gem/ruby/2.7.1/gems/spring-2.1.0/lib/spring/binstub.rb:11:in `<top (required)>'
    75: from /Users/jay/.gem/ruby/2.7.1/gems/spring-2.1.0/lib/spring/binstub.rb:11:in `load'
    74: from /Users/jay/.gem/ruby/2.7.1/gems/spring-2.1.0/bin/spring:49:in `<top (required)>'
    73: from /Users/jay/.gem/ruby/2.7.1/gems/spring-2.1.0/lib/spring/client.rb:30:in `run'
    72: from /Users/jay/.gem/ruby/2.7.1/gems/spring-2.1.0/lib/spring/client/command.rb:7:in `call'
    71: from /Users/jay/.gem/ruby/2.7.1/gems/spring-2.1.0/lib/spring/client/rails.rb:28:in `call'
    70: from /Users/jay/.gem/ruby/2.7.1/gems/spring-2.1.0/lib/spring/client/rails.rb:28:in `load'
    69: from /Users/jay/Dev/rails/one/bin/rails:9:in `<top (required)>'
    68: from /Users/jay/.gem/ruby/2.7.1/gems/activesupport-6.0.3.2/lib/active_support/dependencies.rb:324:in `require'
    67: from /Users/jay/.gem/ruby/2.7.1/gems/activesupport-6.0.3.2/lib/active_support/dependencies.rb:291:in `load_dependency'

  *********************************************************************
  ********** more stack messages **************************************
  *********************************************************************

     2: from /Users/jay/.gem/ruby/2.7.1/gems/bootsnap-1.4.6/lib/bootsnap/load_path_cache/loaded_features_index.rb:92:in `register'
     1: from /Users/jay/.gem/ruby/2.7.1/gems/bootsnap-1.4.6/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:23:in `block in require_with_bootsnap_lfi'
/Users/jay/.gem/ruby/2.7.1/gems/bootsnap-1.4.6/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:23:in `require': incompatible library version - /Users/jay/.gem/ruby/2.7.1/gems/nio4r-2.5.2/lib/nio4r_ext.bundle (LoadError)
{9:19}~/dev/rails/one:master ✗ ➭ bundle exec spring binstub --all
* bin/rake: Spring already present
* bin/rails: Spring already present
{9:21}~/dev/rails/one:master ✗ ➭ bundler -v
Bundler version 2.1.4
{9:21}~/dev/rails/one:master ✗ ➭ bundle exec spring -v
Spring version 2.1.0

I've tried to look up other occurrences of this issue and have found similar things (eg Spring and middleware conflict?) but none of them solve my problem. I'm pretty sure it's an environment thing, but can't figure it out. I would have thought that fresh installs of ruby, rails and a newly created rails app would just work, but it seems not. Any suggestions much appreciated. I should add that if I do the same on ruby v 2.6.6 it works fine.

Thanks

jjnevis
  • 2,672
  • 3
  • 22
  • 22

1 Answers1

1

I have a very similar set up as you (ruby 2.7.1, MacOS 10.15.5, Bundler 2.1.4, etc.) and I ran into a similar issue. Saw this statement in a popular rails tutorial (see image). Lots of people have issues with spring so try creating a new rails app without the spring and listen gems (in terminal write: $ rails new blog --skip-spring --skip-listen). Hope this helps!

screenshot

Franklin Yu
  • 8,920
  • 6
  • 43
  • 57
Nick
  • 11
  • 1
  • Looks like the image didn't load, so here's the direct quote form the guide, "If you're using Windows Subsystem for Linux then there are currently some limitations on file system notifications that mean you should disable the spring and listen gems which you can do by running rails new blog --skip-spring --skip-listen." – Nick Jul 06 '20 at 22:27
  • Thanks Nick, unfortunately this does not solve my problem, I'm just sticking with ruby 2.6.6 for now since that works fine for some reason. – jjnevis Jul 07 '20 at 07:14
  • That comment is about WSL which is known for file system issues. Spring is expected to work fine on macOS. – Franklin Yu Aug 07 '20 at 04:05