หน้าเว็บ

About me

Hi, I'm cheer. My interest relates to artificial intelligence, machine learning, computer vision, network communication, security algorithm.

วันอาทิตย์ที่ 19 ธันวาคม พ.ศ. 2553

RoR on Windows

  1. Install Ruby via the ruby website
  2. Install RubyGems.
  3. Install Rails:
  • In the command prompt, type gem install rails –include-dependencies.
  • If this doesn’t work, you’ve likely got RubyGems problems. You can download the stand-alone package for Rails and install from there, but you’ll likely want to take care of your RubyGems issues before moving on.

Database Installation

  1. Install PostgreSQL:
  2. Download the latest win32 version of PostgreSQL (64-bit is not currently supported on Windows systems).
  3. Initiate the installer and walk through the wizard. A couple of potential “gotcha” spots:
    1. Let the installer create a new Windows account so PostgreSQL can run as a service (I accepted the default postgres account and specified my own password).
    2. Let the database initialize a cluster for you.
  4. Install postgres-pr gem, which is a Ruby driver for PostgreSQL:
    1. Command line: gem install postgres-pr.
    2. Using the pgAdminIII gui that is installed by default with PostgreSQL, create your application databases. Follow the Ruby on Rails naming convention ofApplicationName_development, ApplicationName_test,ApplicationName_production when naming them.
  5. Configure your application to connect to the database(s):
    1. Open up your config/database.yml file and enter the following information for, at the very least, the development database:
      1. adapter: postgresql
      2. database: your_database
      3. username: postgres
      4. password: YourPassword
      5. host: localhost (assuming that you’re running PostgreSQL locally)
  6. Test your database connectivity:
    1. From the top level of your Rails application, type the following at a command prompt: rake db:migrate.
    2. If you get a response similar to this: (in c:/dev/YourWebApplication), you are good to go. If you get an error message, walk through the steps again, double-checking your configuration and fixing any mistakes (a Google search of the error is probably the best place to start).
credit: