ZenTest "invalid gemspec" / "Illformed requirement"
Today I ran into this:
Invalid gemspec in [/usr/local/rvm/gems/ruby-1.9.3-p194/specifications/ZenTest-4.9.3.gemspec]: Illformed requirement ["< 2.1, >= 1.8"].
You need a newer Rubygems version. Try this: gem update --system 1.8.29
Related cards:
Fix error: Invalid gemspec / Illformed requirement
When you get an error like this:
Invalid gemspec in [/opt/www/foo-project.makandra.de/shared/bundle/ruby/1.8/specifications/carrierwave-0.6.2.gemspec]: Illformed requirement ["#<YAML::Syck::DefaultKey:0x7fda6f84d2e8> 1.1.4"]
... the mach...
Devise: Invalidating all sessions for a user
Background information about session storage in Rails
Rails has a default mechanism to store the session in the [CookieStore
](https://api.rubyonrails.org/v7.0.8/classes/ActionD...
Dealing with I18n::InvalidPluralizationData errors
When localizing model attributes via I18n you may run into errors like this:
I18n::InvalidPluralizationData: translation data { ... } can not be used with :count => 1. key 'one' is missing.
They seem to appear out of the blue and the ...
Gemspecs must not list the same gem as both runtime and development dependency
When you're developing a gem, never list the same dependency as both runtime and development dependency in your .gemspec
.
So don't do this:
spec.add_dependency 'activesupport'
spec.add_development_dependency 'activesupport', '~> 2....
Ruby: Fixing strings with invalid encoding and converting to UTF-8
When dealing with external data sources, you may have to deal with improperly encoded strings.
While you should prefer deciding on a single encoding with the data-providing party, you can not always force that on external sources.
It gets worse wh...
Angular: Keeping attributes with invalid values in an ngModel
The Angular 1.2 way:
# By default, angular returns undefined for invalid attributes which removes
# the value from the form field's ngModel (which means it's not sent to the
# server, and old values would not be overwritten).
#
# This directi...
has_one association may silently drop associated record when it is invalid
This is quite an edge case, and appears like a bug in Rails (4.2.6) to me.
Update: This is now documented on Edgeguides Ruby on Rails:
If you set the :va...
How to deal with "invalid %-encoding" error in application for malformed uri
Lead by a discussion of this issue, I built in a middleware which answers those requests with [400] bad request
rather than raising an ArgumentError
.
I put it into app/util
and configured `applicat...
Rails: Configure ActionController to raise when strong params are invalid
Put the line below in the respective env.rb
file to make your action controllers raise an ActionController::UnpermittedParameters
error when strong params are not valid. This might come in handy when you are implementing an API and you want to...
Cucumber may complain about cucumber.yml being invalid when it is valid
Running Cucumber tests while your cucumber.yml is 100% valid may still produce the following error.
cucumber.yml was found, but could not be parsed. Please refer to cucumber's documentation on correct profile usage.
This may in fact be d...