Integrated sensing and communications (ISAC) is emerging as a critical technique for next-generation communication systems. Reconfigurable intelligent surface (RIS) can simultaneously enhance the performance of communication and sensing by introducing new degrees-of-freedom for beamforming in ISAC systems. This paper proposes two optimization techniques for joint beamforming in RIS-assisted ISAC systems. We first aim to maximize the radar mutual information (MI) by imposing constraints on communication rate, transmit power, and unit modulus reflection coefficients at the RIS. An alternating optimization (AO) algorithm based on the semidefinite relaxation (SDR) method is proposed to solve the optimization problem by introducing a convergence-accelerating method. To achieve lower computational complexity and better reliability, we then formulate a new optimization problem for maximizing the weighted ISAC performance metrics under fewer constraints. An AO algorithm based on the Riemannian gradient (RG) method is proposed to solve this problem. This is achieved by reformulating the transmit and RIS beamforming on the complex hypersphere manifold and complex circle manifold, respectively. Numerical results show that the proposed algorithms can enhance the radar MI and the weighted communication rate simultaneously. The AO algorithm based on RG exhibits better performance than the SDR-based method.