Installing Ruby on Rails on Windows

    I was interested in Rails. I bought a couple of books, read ... enough to comb my hands and it's time to put a subject. And proceed ... at least to experiment.

    Task: install Rails under Windows 7 (do not ask me why) and start the server.

    It turned out - this is a quest. A pair of mouse clicks is not enough. Of course, if you do not use the Railsinstaller , what I was rightly hinted at in the comments (thanks, dreamfall).

    A few hours of my searches, which culminated in a complete and unconditional installation, under the cut.


    1. We put Ruby . Strictly from here rubyinstaller.org/downloads . Because here it is built under gcc MinGW 32, which will be used to build ruby ​​modules
    1.1We will need version 187 . Version 192 requires a more powerful shamanism, for which I did not have enough mana.
    1.2 We put the Development Kit (we need it to build Rails), unpacking it directly on top of the Ruby directory (if you installed it by default it is C: \ Ruby187, hereafter we'll call it $ Ruby )
    1.3 You can download the Ruby documentation at the same time

    2. We need SQLite www.sqlite.org . Unpack the archive with the dll and def file directly into the $ Ruby \ bin directory . By the way, this was the first surprise (before RDBMS, the “default” was mySQL)

    3. RunComand Prompt wiht Ruby (you will find it in the windows start-menu)

    4. In the comand prompt we put the modules:
    4.1. gem install sqlite3-ruby - SQLite
    4.2. gem install rails - the "rails" themselves. It is possible that the installation will fail with an error, in this case we repeat the
    4.3 command . Even if the error did not happen, shamanism will still be required. For, for each of our sneezes, such indecency will come out:
    Invalid gemspec in [C: /Ruby187/lib/ruby/gems/1.8/specifications/json-1.6.1.gemspec]: invalid date format in specification: "2011- 09-18 00: 00: 00.000000000Z ” .
    This is a date format error. It is treated simply. Go to the directory$ Ruby \ lib \ ruby ​​\ gems \ 1.8 \ specifications and in the files “with an error” we change the line
    s.date = %q{2011-09-18 00:00:00.000000000Z}
    to
    s.date = %q{2011-09-18}
    4.4. To calm my conscience gem update rails --include-dependencies

    5. Create a test application. In the same place, in Command prompt
    5.1, go to the “for games” directory, for example cd \ test (or mkdir \ test; cd \ test - if there is no such directory)
    5.2 We create the rails new hello application . The second surprise is that the books did not say anything about “new”.
    5.3 Launch our application. cd hello; rails server . And the last surprise is that in the same books a link to the rails server / script script no longer exists
    5.4 at localhost : 3000 , we suddenly find our long-awaited application.

    Voila!

    The continuation will follow if even pitfalls are discovered as they deepen.

    Also popular now: