Things have been working fine, but I've just updated the gems via `bundle update` and now my `/register` page is showing an error:

> 
> **NoMethodError in Users#new\_signup**  
> 
> undefined method `new' for nil:NilClass
> 
> 
> 

![enter image description here](https://i.stack.imgur.com/R7R6J.png)

The error is on the `form_for` line in the view.
This is the `users_controller`'s action:

```
def new_signup
  @user = User.new
  @user.practice = Practice.new
  render :layout => 'login'
end

```

Here's the view `new_signup.html.erb`:

```
<h1>Sign Up</h1>
<%= form_for @user, url: '/register' do |f| %>
  ...
<% end %>

```

For clarify, `new_signup` action in the `users_controller` routes to the `/register` url in `routes.rb`:

```
Rails.application.routes.draw do
  get 'register', to: 'users#new_signup', as: 'register'
  post 'register', to: 'users#create_signup'
  ...
end

```

**Is something wrong with any of this? What could I even debug?** I've tried changing *form\_for* to `form_for User.new url: '/register' do |f|` doesn't help.

I've done an `abort @user.inspect` which returns an empty hash of all the fields in my model..which seems like that's what it *should* output.

Here's the output from the `bundle update`:

```
$ bundle update
Fetching gem metadata from https://rubygems.org/............
Resolving dependencies...
Installing rake 10.4.2 (was 10.3.2)
Installing i18n 0.7.0 (was 0.6.11)
Installing json 1.8.2 (was 1.8.1)
Installing minitest 5.5.1 (was 5.4.2)
Using thread_safe 0.3.4
Using tzinfo 1.2.2
Using activesupport 4.1.1
Using builder 3.2.2
Using erubis 2.7.0
Using actionview 4.1.1
Using rack 1.5.2
Installing rack-test 0.6.3 (was 0.6.2)
Using actionpack 4.1.1
Using mime-types 1.25.1
Using polyglot 0.3.5
Using treetop 1.4.15
Using mail 2.5.4
Using actionmailer 4.1.1
Using activemodel 4.1.1
Using arel 5.0.1.20140414130214
Using activerecord 4.1.1
Using encryptor 1.3.0
Using attr_encrypted 1.3.3
Installing bcrypt 3.1.9 (was 3.1.7)
Using bundler 1.7.3
Using chronic 0.10.2
Using coffee-script-source 1.8.0
Installing execjs 2.2.2 (was 2.2.1)
Using coffee-script 2.3.0
Using thor 0.19.1
Using railties 4.1.1
Using coffee-rails 4.0.1
Installing hashie 3.3.2 (was 3.3.1)
Using hike 1.2.3
Using multi_json 1.10.1
Installing jbuilder 2.2.6 (was 2.2.1)
Using jquery-rails 3.1.2
Installing pg 0.18.1 (was 0.17.1)
Using tilt 1.4.1
Installing sprockets 2.12.3 (was 2.11.0)
Installing sprockets-rails 2.2.2 (was 2.1.4)
Using rails 4.1.1
Installing rdoc 4.2.0 (was 4.1.2)
Using sass 3.2.19
Installing sass-rails 4.0.5 (was 4.0.3)
Installing valuable 0.9.9 (was 0.9.8)
Installing schema_plus 1.8.4 (was 1.6.0)
Using sdoc 0.4.1
Installing spring 1.2.0 (was 1.1.3)
Installing turbolinks 2.5.3 (was 2.4.0)
Installing uglifier 2.7.0 (was 2.5.3)
Using whenever 0.9.4
Updating files in vendor/cache
  * rake-10.4.2.gem
  * i18n-0.7.0.gem
  * json-1.8.2.gem
  * minitest-5.5.1.gem
  * rack-test-0.6.3.gem
  * bcrypt-3.1.9.gem
  * execjs-2.2.2.gem
  * hashie-3.3.2.gem
  * jbuilder-2.2.6.gem
  * pg-0.18.1.gem
  * sprockets-2.12.3.gem
  * sprockets-rails-2.2.2.gem
  * rdoc-4.2.0.gem
  * sass-rails-4.0.5.gem
  * valuable-0.9.9.gem
  * schema_plus-1.8.4.gem
  * spring-1.2.0.gem
  * turbolinks-2.5.3.gem
  * uglifier-2.7.0.gem
Removing outdated .gem files from vendor/cache
  * spring-1.1.3.gem
  * uglifier-2.5.3.gem
  * json-1.8.1.gem
  * rake-10.3.2.gem
  * schema_plus-1.6.0.gem
  * pg-0.17.1.gem
  * rack-test-0.6.2.gem
  * sass-rails-4.0.3.gem
  * turbolinks-2.4.0.gem
  * execjs-2.2.1.gem
  * bcrypt-3.1.7.gem
  * hashie-3.3.1.gem
  * i18n-0.6.11.gem
  * rdoc-4.1.2.gem
  * minitest-5.4.2.gem
  * valuable-0.9.8.gem
  * jbuilder-2.2.1.gem
  * sprockets-2.11.0.gem
  * sprockets-rails-2.1.4.gem
Your bundle is updated!

```

**Update 1:**

I've followed [Jay's process](https://stackoverflow.com/a/28060781/426935) below to try to create a User via the console. That has worked fine, but this error via the URL persists.

**Update 2:**

Still no luck. I've installed Better Errors and I'm looking through the Full Stack Trace. The error appears to be in the `form_for` helper as it's trying to instantiate the form for the User class, which it doesn't think has a `new` method.

Since the `@user` instance variable is already a new instance of a User, doesn't it make sense that it doesn't have a `new` method?

I've dumped the trace into JSFiddle (obviously the links aren't then clickable, so I've created a fiddle for the top 3 items of the Full Trace):

* form\_helper#instantiate\_builder: <http://jsfiddle.net/tz4he49d/embedded/result/>
* form\_for: <http://jsfiddle.net/Lu2fd6u0/embedded/result/>
==========================================================
* Users#new\_signup: <http://jsfiddle.net/z217ueqj/embedded/result/> (image shown below)

[![enter image description here](https://i.stack.imgur.com/LwqxR.png)](http://jsfiddle.net/z217ueqj/embedded/result/)