I recently ran a bundle update
and now I am getting a weird
Type - [17] is not a symbol
error.
This is the full error message:
There are a few things to note here:
bundle update
You should get into the practice of using the pessimistic version constraint (the ~>
operator) in your Gemfile. This essentially allows you to say that gems can only be updated to higher patch levels.
Ruby developers tend to use the standard of version numbers with three numbers: x.x.x, e.g. 2.0.1. The first number is the major version, the second number the minor version and the third number is the patch.
Major version updates are likely to break old functionality. If you upgrade from 1.x.x to 2.x.x, it could be a painful process. Minor version updates should add features and, in rare cases, change existing functionality, but it should be backwards compatible. Patch level updates should be purely bug fixes.
The pessimistic version constraint can be used to say "only allow patch level updates". For example:
gem 'devise', '~> 2.2.3' # Only the '.3' can increase, e.g. 2.2.4, 2.2.5
If you do this for all of your gems then you can be reasonably sure that bundle update
will update gems to compatible versions. In your Gemfile you have
gem 'devise', '>= 2.2.3'
This would potentially allow the installation of devise 3.0.0, which you can almost guarantee would be problematic.
It's good practice to find a gem configuration that works, then use the pessimistic version constraint to lock your Gemfile down to only patch level updates.
It looks like devise has been updated, which has caused a session deserialization problem. You could check out an old version of your Gemfile.lock
, then downgrade to the devise version that was working. Or you could just clear your cache if you don't have anything critical in the session and use the new version.
Running bundle update
will attempt to update all gems in your Gemfile. If you only need to update a single gem, use bundle update
. All the others will remain at the same version.