SitePoint Sponsor

User Tag List

Results 1 to 4 of 4
  1. #1
    SitePoint Enthusiast TannerC's Avatar
    Join Date
    Mar 2005
    Location
    Orem, UT
    Posts
    65
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Using RoR, error when using rake migrate.

    Sorry if this is in the wrong forum. I'm completely a newbie to this type of stuff, but I'm trying my best to get this to work. Basically I'm using Locomotive to get started, I've used the Monkeys "hello" example but when i get to the end I'm supposed to create a simple database and then generate a scaffold for it, but when I try to create the database with "rake scaffold" I get this error:

    "Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2)"

    Why would I be getting this error?
    Visit Creative Something, my creativity blog.

  2. #2
    SitePoint Enthusiast Stevenwulf's Avatar
    Join Date
    May 2002
    Location
    Berkeley
    Posts
    76
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    It would be easier to help if you posted the following: the OS you are using, what your database.yml file looks like.

    This may sound like a dumb question, but are you sure your MySql server is running?

    Regards,
    Steven

  3. #3
    SitePoint Enthusiast TannerC's Avatar
    Join Date
    Mar 2005
    Location
    Orem, UT
    Posts
    65
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Sorry for the lack of details, like I said I'm a complete newbie. Anyway, I found the problem on my own after rumaging through the internet for another hour. The MySQL server was running, but I had to change the my database from app_develpopment to just app. That's fixed the problem.
    Visit Creative Something, my creativity blog.

  4. #4
    SitePoint Evangelist
    Join Date
    Feb 2006
    Location
    Worcs. UK
    Posts
    404
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Are you connecting to an existing database, or starting from scratch?

    If you are starting from scratch, you would be better off keeping the default app_development in the Rails config and creating a matching app_development database in MySQL.

    Rails works best when you keep to the conventions. The standard one for databases is that each application has three databases. In your case these would be:

    app_development
    app_test
    app_production

    If this is an existing database, it is probably worth creating a copy of that app database and calling it app_development. Then develop using that database so that you don't develop using live data.


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •