Build a rails running environment

Source: Internet
Author: User
Tags imagemagick

Today, the system is reinstalled and the running environment of rails is re-built. Therefore, the following commands are based on the latest situation.

Install Ruby one-click Installer

Note: Try not to install those new versions. Ruby and rails are not very friendly to Windows. Generally, the mswin32 versions of these class libraries are the latest. Trade rashly acts as a mouse, So you suffer. The version I installed is 1.8.6-25.

Then, add c: \ Ruby \ bin to the system variables to install Ruby and the following Ruby class libraries (GEM.

Ruby-mswin32 ruby-1.8.6-p287 zlib-lib 1.2.3 zlib 0.6.0 unzip 1.2.0 rake 0.8.2 rubysrc unzip-unzip OpenSSL 0.9.8d fxruby 1.6.16 fxri unzip scite 1.76 OpenGL 0.60.0 glut unzip swin 070409 vruby 080229 expat 2.0.1 xmlparser unzip hpricot 0.6 unzip DBD/ODBC 0.9995 win32-api 1.2.0 windows-API 0.2.4 windows-Pr 0.9.3 win32-file-stat 1.3.1 win32-file 0.5.5 win32-clipboard 0.4.4 win32-dir 0.3.2 win32-eventlog 0.5.0 win32-process 0.5.9 win32-sapi 0.1.4 win32-sound 0.4.1 log4r 1.0.5 programming Ruby 1st edition libfcgi 2.4.0 ruby- fcgi 0.8.7 iconv 1.8 Readline 4.3-2 pdcurses 2.60-1 gdbm 1.8.3-1 installer-patches 1.8.6

You can use ruby-V to verify it!

Upgrade gems
 
Gem update -- system2011.20.gem install rubygems-updateupdate_rubygems

After the upgrade, We will clean up the old version of the gem.

 
Gem clean
Upgrade rubygems itself

If you run the above gem update -- system command, you can run

 
Gem install rubygems-updateupdate_rubygems

View gems details

 
Gem env

Accelerate Remote Installation.

 
Gem install XXXX -- no-rdoc -- no-ri
Install rails
 
Gem install rackgem install rakegem install rails-V = 2.3.2 -- source = http://gems.rubyonrails.org

Or directly to http://rubyforge.org/frs? Group_id = download in 307

Install MySQL support

First install libmysql in the bin directory of mysql5.0.22 (do not use version 5.1, they have problems on rails2.3. DLL is copied to the bin directory of Ruby and C: \ WINDOWS \ System32. to solve the problem of rails connecting to MySQL. Then

 
Gem install MySQL -- no-rdoc -- no-ri

Because the mysql. Gem document has never been installed in the window, we have to give up on it.

Other useful commands:

Set the installation Source
 
Gem sources-A http://gems.github.comgem sources-A http://gems.rubyforge.org
Install action_mailer_tls (mail via Gmail)
 
Gem install openrain-action_mailer_tls-s http://gems.github.com
Install rmagick
    • To http://rubyforge.org/frs? Group_id1_12&release_id=8170 download rmagick-2.10.0-imagemagick-6.5.3-10-q8.zip.
    • Unzip the package and execute the gem install rmagick-2.10.0-x86-mswin32.gem in the directory.
    • Finally, double-click imagemagick-6.5.3-10-q8-windows-dll.exe to install ImageMagick and check all the items that can be checked.
    • Add the installation directory of ImageMagick to the environment variable path. If there is one, no more
    • Http://www.microsoft.com/downloads/thankyou.aspx? Familyid = 9b2da534-3e03-4391-8a4d-074b9f2bc1bf & displaylang = ZH-CN
      Download an item and click Install. Restart netbeans to complete the installation!
Install mongrel

Webrick is a web server suitable for development mode. It is installed and released with Ruby on Rails. However, if you want to process faster or plan to deploy your applicationProgramMongrel is a more appropriate web server.

 
Gem install mongrel

Sometimes when we run the project, we will report' ': Invalid multibyte character (argumenterror) error:

Solution see http://handy-wang.javaeye.com/blog/472142

Freeze

Freeze refers to copying a version of rails to the vendor directory of the project. To ensure that the external rails gems does not affect this project.

 
Rake rails: Freeze: gems
Name, status
Such names have special meanings and should not be used as global variables.

FF supports adding a comma at the end of array and JSON.
VaR A = [1, 2,];
VaR J = {A: 1, B: 2 ,}

Note:

Because common dogs do evil, you need to use a proxy to remotely load the gem.

Currently, I can only use rubygems to download the required gem and install it locally.

 If the native gem requires installed build tools error is reported, refer to release Setup Guide for Ruby, cucumber and watir or selenium WebDriver on Windows: first download the devkit Installation File DevKit-tdm-32 below win -....... EXE, decompress the package through the command line to enter the decompress the file, in turn run the following command line: https://github.com/oneclick/rubyinstaller/downloads/ruby DK. RB initruby DK. RB installthin depends on many gemem install eventmachinegem install daemons install gem install fcgi which may cause problems. 

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.