Q:

Rails fresh install throws TypeError, points to spring gem

I keep getting the following error when I try to use the rails command from within my application directory:
/Users/useraccount/.rvm/gems/ruby-2.4.0/gems/spring-2.0.2/lib/spring/client/rails.rb:28:in `load': no implicit conversion of nil into String (TypeError)

Here's how I got there...
After installing and updating all the necessary software, I am beginning with the following configuration: 

Mac OS Sierra 10.12.5
xcode 8.3.3
Rails 5.1.1
ruby 2.4.1p111 (2017-03-22 revision 58053) [x86_64-darwin16] ruby 2.4.0p0 (2016-12-24 revision 57164) [x86_64-darwin16]
rubygem 2.6.12
Homebrew 1.2.3
Homebrew/homebrew-core (git revision ab5ba7; last commit 2017-06-19)

I went into my project folder and ran the following:
$ rails new testapp
...output omitted...
$ cd testapp
$ rails s

This is the point where I get the TypeError. If I run rails -v it gives me the same error.

Here's the full trace:
/Users/useraccount/.rvm/gems/ruby-2.4.0/gems/spring-2.0.2/lib/spring/client/rails.rb:28:in `load': no implicit conversion of nil into String (TypeError)
    from /Users/useraccount/.rvm/gems/ruby-2.4.0/gems/spring-2.0.2/lib/spring/client/rails.rb:28:in `call'
    from /Users/useraccount/.rvm/gems/ruby-2.4.0/gems/spring-2.0.2/lib/spring/client/command.rb:7:in `call'
    from /Users/useraccount/.rvm/gems/ruby-2.4.0/gems/spring-2.0.2/lib/spring/client.rb:30:in `run'
    from /Users/useraccount/.rvm/gems/ruby-2.4.0/gems/spring-2.0.2/bin/spring:49:in `<top (required)>'
    from /Users/useraccount/.rvm/gems/ruby-2.4.0/gems/spring-2.0.2/lib/spring/binstub.rb:31:in `load'
    from /Users/useraccount/.rvm/gems/ruby-2.4.0/gems/spring-2.0.2/lib/spring/binstub.rb:31:in `<top (required)>'
    from /Users/useraccount/Google Drive Family/code/Rails/12-Week-Challenge/Week_0 [Dry Run]/testapp/bin/spring:15:in `require'
    from /Users/useraccount/Google Drive Family/code/Rails/12-Week-Challenge/Week_0 [Dry Run]/testapp/bin/spring:15:in `<top (required)>'
    from bin/rails:3:in `load'
    from bin/rails:3:in `<main>'

Update 1:
I upgraded ruby from 2.4.0 to 2.4.1 and the exact same problem persists.
/Users/brianjason/.rvm/gems/ruby-2.4.1/gems/spring-2.0.2/lib/spring/client/rails.rb:28:in `load': no implicit conversion of nil into String (TypeError)

Update 2:
when I comment out spring in the Gemfile the application runs without error:
group :development do
  # Access an IRB console on exception pages or by using <%= console %> anywhere in the code.
  gem 'web-console', '>= 3.3.0'
  gem 'listen', '>= 3.0.5', '< 3.2'
  # Spring speeds up development by keeping your application running in the background. Read more: https://github.com/rails/spring
  #gem 'spring'
  #gem 'spring-watcher-listen', '~> 2.0.0'
end

Then I attempted to move forward with developing the application.
I followed the steps outlined in section 4 of the rails getting started guide
Here's what I got when I tried to run the app:
ActionView::Template::Error (bad URI(is not URI?): file:///Users/useraccount/Google%20Drive%20Family/code/Rails/12-Week-Challenge/Week_0%20[Dry%20Run]/testapp/app/assets/stylesheets/application.css?type=text/css&pipeline=debug):
    4:     <title>Testapp</title>
    5:     <%= csrf_meta_tags %>
    6:
    7:     <%= stylesheet_link_tag    'application', media: 'all', 'data-turbolinks-track': 'reload' %>
    8:     <%= javascript_include_tag 'application', 'data-turbolinks-track': 'reload' %>
    9:   </head>
   10:

app/views/layouts/application.html.erb:7:in `_app_views_layouts_application_html_erb___42966888540102183_70217709639480'

A:

As it turns out, the problem was the result of the folder names in my working directory's path. It appears as though the spaces in the folder names were causing the error.
Once I removed the spaces and changed the folder names from:
/Users/useraccount/Google Drive Family/code/Rails/12-Week-Challenge/Week_0 [Dry Run]/testapp/

to:
/Users/useraccount/Google_Drive_Family/code/Rails/12-Week-Challenge/Week_0_DryRun/testapp/

everything worked perfectly. Problem solved. 

