Rails Server undefined method `specs` for nil:NilClass

Viewed 468

I'm following this guide to get started with Ruby on Rails.

I ran ruby new <projectName>

When I do rails server I get

Traceback (most recent call last):
        2: from bin/rails:2:in `<main>'
        1: from bin/rails:2:in `load'
<projectName>/bin/spring:7:in `<top (required)>': undefined method `specs' for nil:NilClass (NoMethodError)

No searching on SO has revealed anything so far.

I think it could be related to the build process.

When I run bundle install, it goes through the process before seeming to stall out

Fetching sassc 2.4.0
Installing sassc 2.4.0 with native extensions
Killed
1 Answers

I only get this if bundle install didn't run to completion. If you skipped that step or interrupted it the Gemfile.lock isn't properly generated.

The line is:

Bundler.locked_gems.specs.find { ... }

Where Bundler.locked_gems returns nil in the case of a missing .lock file.

This should be better communicated with a proper error message.

Related