The impact of the built environment on the ridership of ride-hailing results depends on the spatial grid scale. The existing research on the demand model of ride-hailing ignores the modifiable areal unit problem (MAUP). Taking Chengdu as an example, and taking the density of pick-ups and drop-offs as dependent variables, 12 explanatory variables were selected as independent variables according to the “5D” built environment theory. The nugget–sill ratio (NSR) method and optimal parameter-based geographical detector (OPGD) model were used to determine the optimal grid scale for the aggregation of the built environment variables and the ridership of ride-hailing. Based on the optimal grid scale, the optimal data discretization method of the explanatory variables was determined by comparing the results of the geographic detector under different discretization methods (such as the natural break method, k-means clustering method, equidistant method, and quantile method); we utilized the geographic detector model to explore the relative importance and the interactive impacts of the explanatory variables on the ridership of ride-hailing under the optimal grid scale and optimal data discretization method. The results indicated that: (1) the suggested grid scale for the aggregation of the built environment and ride-hailing ridership in Chengdu is 1100 m; (2) the optimal data discretization method is the quantile method; (3) the floor area ratio (FAR), distance from the nearest subway station, and residential POI (point of interest) density resulted in a relatively high importance of the explanatory variable that affects the ridership of ride-hailing; and (4) the interactions of the diversity index of mixed land use ∩ FAR, distance to the nearest subway station ∩ FAR, transportation POI density ∩ FAR, and distance to the central business district (CBD) ∩ FAR made a higher contribution to ride-hailing ridership than the single-factor effect of FAR, which had the highest contribution compared with the other explanatory variables. The proposed grid scale can provide the basis for the partitioning management and scheduling optimization of ride-hailing. In the process of adjusting the ride-hailing demand, the ranking results of the importance and interaction of the built-environment explanatory variables offer valuable references for formulating the priority renewal order and proposing a scientific combination scheme of the built-environment factors.