ROS2 command not recognized on MAC after installation

I solved the problem by adding this command to .bash_profile

. ~/ros2_install/ros2-osx/setup.bash