When I enter:
tune_spec<- decision_tree(min_n= tune(), tree_depth= tune(), cost_complexity=tune()) %>% 
  set_engine("rpart") %>% 
  set_mode("regression")
tree_grid<- tune_spec %>% 
  extract_parameter_set_dials() %>% 
  grid_regular(levels=3)
set.seed(275)
folds<- vfold_cv(trains_set, v=3)
fits_cv<- fit_resamples(tune_spec, outcome~., resamples= folds, metrics= metric_set(rmse))
I get the error:
! 3 arguments have been tagged for tuning in these components: model_spec. 
Please use one of the tuning functions (e.g. `tune_grid()`) to optimize them.
When I tried tunegrid():
tune_results<- tune_grid(tune_spec, outcome~., resamples= folds, grid= tree_grid, metrics= metric_set(rmse))
I got the errors factor has new levels and There were issues with some computations
 
    