geom_linerange accepts either x or y, but not both. More likely though, the ymax and ymin you've supplied are the same.
Summarizing the min and max values and providing the summary values to geom_linerange() should do the trick.
diamonds %>%
group_by(cut) %>%
summarize(
min_depth = min(depth),
max_depth = max(depth)
) %>%
ggplot() +
geom_linerange(aes(x=cut,
ymin=min_depth,
ymax=max_depth))