Installing HomeBrew, RVM, Ruby on Rails, MySql for newbies from Scratch.
When I got my new MacBook Pro, I was trying to install Ruby on Rails and MySql from Scratch. But due to lot of installing options, I screwed up installation and was stuck.
So, I wanted to let newbies know simple installation of RoR, MySql and get your RoR app running.
Here are the steps described below:
Step 1: Clean up your previously installed RVM and Xcode. If you haven’t installed, then skip this step.
Enter following Commands in your Terminal:
rm -rf ~/.rvm
sudo rm -rf /Developer
Step 2: Install Xcode from App Store or your previous installer might be saved in Launchpad, Install from there.
Step 3: Install HomeBrew:
Enter following Commands in your Terminal:
mkdir -p /usr/local/Cellar
/usr/bin/ruby -e "$(curl -fsSL https://raw.github.com/gist/323731)"
Step 4: Install RVM:
Enter following Commands in your Terminal:
bash < <(curl -s https://rvm.beginrescueend.com/install/rvm)
echo '[[ -s "$HOME/.rvm/scripts/rvm" ]] && . "$HOME/.rvm/scripts/rvm" # Load RVM function' >> ~/.bash_profile
Step 5: Install Ruby 1.9.2
Enter following Commands in your Terminal:
rvm install 1.9.2
rvm use ruby-1.9.2 --default
gem install rails thin bundler
rvm install 1.9.2-head
brew install git ack wget curl redis memcached libmemcached colordiff imagemagick
You can use whatever version of Ruby you want to. To see about different versions of Ruby click here
Step 6: Install MySql:
Enter following Commands in your Terminal:
brew install mysql
mysql_install_db --verbose --user=`whoami` --basedir="$(brew --prefix mysql)" --datadir=/usr/local/var/mysql --tmpdir=/tmp
# To Launch MySql after you start your Mac
mkdir -p ~/Library/LaunchAgents
cp /usr/local/Cellar/mysql/5.5.15/com.mysql.mysqld.plist ~/Library/LaunchAgents/
# Always check your version of MySql, mine was 5.5.15
launchctl load -w ~/Library/LaunchAgents/com.mysql.mysqld.plist
# Restart your system. # Enter as root if you want
mysql -u root
# Set your new password of MySql, by default its blank
UPDATE mysql.user SET Password=PASSWORD('your_password') WHERE User='root';
FLUSH PRIVILEGES;
quit
YAY!!! you are done :)
39 Notes/ Hide
-
transientyou83 likes this
-
mildredbod8 likes this
-
stephensok85 likes this
-
kathleentag901 likes this
-
manishdas posted this