Reconfigurable intelligent surface (RIS) can improve the capacity of the wireless communication system by providing the extra link between the base station (BS) and the user. In order to resist the "multiplicative fading" effect, RIS is more likely to develop into extremely large-scale RIS (XL-RIS) for future 6G communications. Beam training is an effective way to acquire channel state information (CSI) for the XL-RIS assisted system. Existing beam training schemes rely on the far-field codebook, which is designed based on the far-field channel model. However, due to the large aperture of XL-RIS, the user is more likely to be in the near-field region of XL-RIS. The far-field codebook mismatches the near-field channel model. Thus, the existing far-field beam training scheme will cause severe performance loss in the XL-RIS assisted near-field communications. To solve this problem, we propose the efficient near-field beam training schemes by designing the near-field codebook to match the near-field channel model. Specifically, we firstly design the near-field codebook by considering the near-field cascaded array steering vector of XL-RIS. Then, the optimal codeword for XL-RIS is obtained by the exhausted training procedure between the XL-RIS and the user. In order to reduce the beam training overhead, we further design a hierarchical near-field codebook and propose the corresponding hierarchical near-field beam training scheme, where different levels of sub-codebooks are searched in turn with reduced codebook size. Simulation results show the two proposed near-field beam training schemes both perform better than the existing far-field beam training scheme. Particulary, the hierarchical near-field beam training scheme can greatly reduce the beam training overhead with acceptable performance loss.