# JuMP diet tutorial issue?

**URL:** <https://discourse.julialang.org/t/jump-diet-tutorial-issue/130231>\
**Category:** Optimization (Mathematical)\
**Tags:** jump\
**Created:** [June 26, 2025, 12:30pm UTC](https://discourse.julialang.org/t/jump-diet-tutorial-issue/130231 "2025-06-26T12:30:07Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Vee\_Kalkunte](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/vee_kalkunte/32/214770_2.png) [@Vee\_Kalkunte](https://discourse.julialang.org/u/Vee_Kalkunte)\
**Post date:** [June 26, 2025, 12:30pm UTC](https://discourse.julialang.org/t/jump-diet-tutorial-issue/130231/1 "2025-06-26T12:30:07Z")

</div>

Hi!

I’m following the JuMP documentation’s Diet problem code, and I’m running into a constraint error (“_ERROR: At code.jl:66: `@constraint(model, row.min <= sum(foods[!, row.nutrient] .* foods.x) <= row.max)`: Unrecognized constraint building format…This is due to specifying an unrecognized function, constraint set, and/or extra positional/keyword arguments_.”)

on this bit of code:

@constraint(  
model,  
[row in eachrow(limits)],  
row.min \<= sum(foods[!, row.nutrient] .\* foods.x) \<= row.max,  
);

Can someone pretty please help me figure out what’s going wrong?

---

<div class="post-metadata">

**Author:** ![araujoms](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/araujoms/32/217734_2.png) [@araujoms](https://discourse.julialang.org/u/araujoms)\
**Post date:** [June 26, 2025, 1:22pm UTC](https://discourse.julialang.org/t/jump-diet-tutorial-issue/130231/2 "2025-06-26T13:22:49Z")

</div>

You forgot to copy paste this part of the tutorial:

```julia
limits.max = coalesce.(limits.max, Inf)

```

This makes the `missing` in `limits` cause an error when you try to build the constraint. In general it’s easier to download the entire file via the link [_Download the source as a `.jl` file_](https://jump.dev/JuMP.jl/stable/tutorials/linear/diet.jl) at the top of the tutorial, this gives you a well-formatted error-free file to work upon.

---

<div class="post-metadata">

**Author:** ![Vee\_Kalkunte](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/vee_kalkunte/32/214770_2.png) [@Vee\_Kalkunte](https://discourse.julialang.org/u/Vee_Kalkunte)\
**Post date:** [June 26, 2025, 9:22pm UTC](https://discourse.julialang.org/t/jump-diet-tutorial-issue/130231/3 "2025-06-26T21:22:06Z")

</div>

Thanks!!!
