Unfortunately, after running
rails new mynewapp -d=mysqland testing out
rails serverI got this error:
error: 'Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2)'
Of course I hadn't (1) started the MySQL server yet and (2) created my development database. This was new to me since I normally just developed with the sqlite db Rails automatically ships with for development.
After using homebrew to install mysql ("brew install mysql" as Ryan Bigg suggests at http://ryanbigg.com/2011/06/mac-os-x-ruby-rvm-rails-and-you/), I followed the added installation instructions that come with the brew install (viewable through "brew info mysql"
- pretty darn important to finish the mysql install with homebrew), and then ran these commands:
- pretty darn important to finish the mysql install with homebrew), and then ran these commands:
# start the server - something I'm not used to after using sqlite
mysql.server start# create the db; specify -p if necessary
mysqladmin -u root create mynewapp_development
Then, "rails server" was successful.
(Note: running "mysql.server start" won't be necessary if you follow the instructions from "brew info mysql" and configure the start server on startup)
No comments:
Post a Comment
Please be considerate in what you say.