gem
, generate and launch the first application.Windows
as simple as possible, and all because one generous programmer named Kurt Hibs has already assembled everything we need to develop RoR applications in one package called Instant Rails
. Packages collected:SQLite
and MySQL
database enginesApache
web server (which, in fact, we do not need ...)Instant Rails
(IR) from the official site , unpack the contents of the archive into any folder (better if located closer to the root of the disk, and there should be no spaces in the way, I recommend C:\ruby
). There are about 18,000 files in the archive, so you have to wait a bit. After we run InstantRails.exe
and click
in the appeared request to register the paths - we don’t need this application at all - we will use a special web server written in Ruby, and we will use SQLite
as the database. Thank you, Kurt, for your efforts, but we stop the Apache and muscle and close all this stuff.gem
comes to the rescue.gem
program is used. Welcome to the console (Start-> All Programs-> Run-> enter cmd
> OK). In it, go to the folder with IR ( cd c:/ruby
) and run use_ruby
( use_ruby.bat
) - this bat file will assign us the necessary paths in the PATH, which will make working with RoR even more convenient, which will make working with RoR even more convenient. We will always work only through use_ruby.bat
, so do not forget to run it. Command: gem list
and see a list of all installed "jams". The gem update
command should gem update
us all, but this will not happen because the update system is already outdated, leaving no backward compatibility. Therefore, the order of the commands is this (in order not to be confused, we will immediately remove the old versions of the jam):gem install rubygems-update
update_rubygems
gem uninstall rails activerecord activeresource activesupport actionpack actionmailer
gem install rails --include-dependencies
Ruby 1.8.6 One-Click Installer
package - it contains additional libraries under Windows, install everything by default. Then go to Start - Ruby-186-xx - Ruby Gems - Ruby Gems package manager and here, as described above, we install the necessary jams (rails - include-dependencies, mysql, mongrel).rails
application was also installed, which will generate a folder structure for the application and create basic code files. We still have to have the “rail console” open, with an invitation in the rails_apps
folder (there will be applications in it). We will create a test
application, command: rails test
. We are waiting for the end of the generation. As you can see, a separate folder was created in which the above structure was placed. Next time we will find out what each folder is for, but for now just run the Mongrel
web server to see the result. In the console, go to the folder with the application ( cd test
) and specify: ruby script/server
. As a result, Mongrel
will be launched:3000
. Well, open the browser and go tohttp://127.0.0.1天000/- and here we are waiting for a test page with a greeting. Yes, you already ride on the tracks with Ruby;) By clicking on
“About your application's environment”
, you will know the parameters of your environment:Source: https://habr.com/ru/post/50085/
All Articles