Configure the Ruby on Rails environment in Windows

Source: Internet
Author: User

We are preparing to build a ruby development environment because we are interested in Ruby recently. Feel the power of Ruby. Some problems have been encountered during the environment setup process. We have recorded the problems in the following article and offered our solutions.

Before getting started, I am using the environment Ruby 1.9.2 and rails 3.0.9.

1. download the latest Ruby version.

URL: http://www.ruby-lang.org/en/downloads/

2. Install Ruby

The downloaded file is an EXE file and you can proceed directly to the next step. You can select the [add path to environment variable path] and [associate Ruby file] options. Not explained.

3. view the installation result

In Windows, enter ruby-V in cmd to view the ruby version. For example:

4. Install rails

It is often easy to install rails. You only need to execute: Gem install rails -- include-dependencies in the command line.

To run this command, you must ensure that the network is smooth.

After the installation is complete, run: rails-V to view the rails version and verify that the installation is successful. For example:

5. Create a blank rails Project

Run: rails new rubyprogram to create a rails project structure named rubyprogramm.

Note: In the referenced references, it is to run rails rubyprogramm. It is not wrong, but different rails versions. Note that.

For the command line:

After the project is successfully created, the project structure is as follows:

6. Start the webrick server that comes with rails.

Pay attention to it here! Is reference material:

Therefore, if you are using rails3.0 or later, you cannot run Ruby script \ Server, but you must run the rails server or rails s command.

Run rails Server

The tragedy continues and the following error occurs. This is true if sqlite3. it is not found. SQLite-Ruby is not installed.

Install sqltie

Run: Gem install sqlite3-ruby

Command line:

Continue running: rails server.

Oh my God, this dialog box is displayed, and sqlite3.dll cannot be found.

Download slqite3.dll on the official website (http://www.sqlite.org/download.html), here to review yourself, in reference materials, has been explained, the need to copy sqlite3.dll to the ruby installation directory of the bin folder.

Download location:

Finally, run rails server. The result is as follows:

7. Input http: // 127.0.0.1: 3000 /.

So far, the establishment of the Ruby on Rails environment in Windows is over. Novice, please make a brick.

Finally, I would like to thank all of you for sharing your reference.

References:

Build http://hain.iteye.com/blog/158426 in Ruby on Rails environment on Windows

Ruby on Rails agile development best practices sharing http://thoughtrails.com/episodes/71-migrate-windows-ruby-187-rails-23-to-linux-ruby-192-rails-3

An English website with the same problem I encountered http://railsforum.com/viewtopic.php? Id = 37569

Rails returns the missing SQLite. dll error http://foreal.iteye.com/blog/1096556 when executing rake DB: Create

Windows Installation Ruby on Rails (ruby1.9.2, rails3.0, sqlite3) http://www.360doc.com/content/11/0119/17/5445056_87661030.shtml

Related Article

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.