I am developing a Ruby on Rails web application that is being hosted on Heroku. I am using Zerb Foundation 5 for styling which works fine in the development environment. If I change the environment to production and restart the server the Foundation components are not rendered correctly. I believe this is a Jquery issue. Here is an example of how the dropdowns should look / how they are being displayed in production:

[working dropdown](https://i.stack.imgur.com/5S3Ry.png) 

[not working dropdown](https://i.stack.imgur.com/EUh1a.png)

When ran in production I get the following error: 

```
Uncaught TypeError: ht.each is not a function
at VM417 application-d4dfc26bd5c2527cd0b1b3ce283f89526f6a65ed0527799d75ae98ccd0415867.js:1
at VM417 application-d4dfc26bd5c2527cd0b1b3ce283f89526f6a65ed0527799d75ae98ccd0415867.js:1
at VM417 application-d4dfc26bd5c2527cd0b1b3ce283f89526f6a65ed0527799d75ae98ccd0415867.js:1

```

which leads me to this line:

```
"function" == typeof Symbol && (ht.fn[Symbol.iterator] = nt[Symbol.iterator]),
ht.each("Boolean Number String Function Array Date RegExp Object Error Symbol".split(" "), function(t, e) {
    lt["[object " + e + "]"] = e.toLowerCase()
});

```

I have tried precompiling and cleaning assets:

```
$ rails assets:clean
$ RAILS_ENV=production bundle exec rails assets:precompile

```

The production database has been created and seeded. I have made several modifications to the environment config files trying to debug this problem. As the issue is only in production it made sense to me that this would be where the issue is coming from.

*config/environments/production.rb*

```
Rails.application.configure do

  config.cache_classes = true

  config.eager_load = true

  config.consider_all_requests_local       = false
  config.action_controller.perform_caching = true

  config.public_file_server.enabled = ENV['RAILS_SERVE_STATIC_FILES'].present?

  config.assets.js_compressor = :uglifier
  config.assets.digest = true

  config.assets.compile = true

  config.active_storage.service = :local

  config.log_level = :debug

  config.log_tags = [ :request_id ]

  config.action_mailer.perform_caching = false

  config.i18n.fallbacks = true

  config.active_support.deprecation = :notify

  config.log_formatter = ::Logger::Formatter.new

  if ENV["RAILS_LOG_TO_STDOUT"].present?
    logger           = ActiveSupport::Logger.new(STDOUT)
    logger.formatter = config.log_formatter
    config.logger    = ActiveSupport::TaggedLogging.new(logger)
  end

  config.active_record.dump_schema_after_migration = false
end

```

*javascripts/applciation.js*

```
//= require jquery
//= require rails-ujs
//= require turbolinks
//= require foundation
//= require_tree .

$(document).on('turbolinks:load', function() {
    $(function(){ $(document).foundation(); });
});

```

From researching, possible reasons for this error I have encountered are:

* **mulitple** inclusions of Foundation
* Some error with **uglifier** causing variable name to be changed to "ht" (seems unlikely)
* production config not set up correctly

I have been working through the heroku tutorials:

<https://devcenter.heroku.com/articles/rails-asset-pipeline#troubleshooting>

<https://devcenter.heroku.com/articles/rails-4-asset-pipeline>

Thanks in advance and please let me know if there is anything that would help to include, I didn't want to clutter up the post with more code haha :)