Running rails s after gem update returns list of warnings - warning: already initialized constant Etc::SC_AIO_LISTIO_MAX
I found solution after running bundle update
command I also run bundle clean --force
and on the next run of rails s
command all warnings disappears.
warning: already initialized constant within config/routes.rb
There are a number of reasons why this error may be happening, but a fix would be to not declare the constant. Not sure it you're using DistributionSlug::MATCH_REGEX
elsewhere in your code, but if you aren't, you can do:
class DistributionSlugConstraint
def self.matches?(request)
request.fullpath =~ /B[a-zA-Z1-9_]{5}/
end
end
If you are using it elsewhere in your code you could make it a class method and call that instead of the constant. Another route to go might be to declare it as a configuration in application.rb
I've seen this kind of thing pop up when using a multi-threaded app server like puma
, or in Sidekiq
jobs. Hard to say more without knowing more about your infrastructure.
Strange Heroku CLI errors / warnings - 'already initialized constant'
Update your plugins with 'heroku plugins:update'
Your pgbackups one is out of date.
how to get rid of ruby's warning: already initialized constant
The easy way:
v, $VERBOSE = $VERBOSE, nil
# code goes here
$VERBOSE = v
Related Topics
How to Use "Gets" on a Rake Task
How to Delete All Contents of a Folder with Ruby-Rails
How to Return Http 204 in a Rails Controller
Rails Convert String to Number
Possible to Alias a Belongs_To Association in Rails
Rails: Respond_To JSON and HTML
How to Call Applicationcontroller Methods from Applicationhelper
Creating an Md5 Hash of a Number, String, Array, or Hash in Ruby
Ruby Array Each_Slice_With_Index
Check Ruby Http Response for Success
How to Attach a Message to Rspec Check