The rails development environment under Ubuntu 14.04

Source: Internet
Author: User

1, the first is the installation of RVM,

$ gpg--keyserver hkp://keys.gnupg.net--recv-keys 409b6b1796c275462a1703113804bb82d39dc0e3

$ Curl-ssl Https://get.rvm.io | Bash-s Stable

$ Source ~/.RVM/SCRIPTS/RVM

echo "Ruby_url=https://cache.ruby-china.org/pub/ruby" > ~/.rvm/user/db

There should be no problem, test RVM, command line input: rvm-v If the version number is returned correctly, OK.

Use environment check: RVM requirements, here encountered the issue of the GCC version is too low, set a Sohu source, update.

sudo vi/etc/apt/sources.list

Join Sohu Source, sudo apt-get update, re-RVM requirements will install other packages.

2, install Ruby, very simple, RVM install 2.3.1 (version number is recommended), and set as the default version of the system: RVM use 2.3.1--default.

Test: Ruby-v return 2.3.1pxxx and so on OK; gem-v should be installed.

* Domestic switch gem Source: Gem sources--add https://gems.ruby-china.org/--remove https://rubygems.org/

3, installation Bundler:gem install Bundler

4. Installing Rails:gem install rails. Rails-v is ready to test the version, currently 4.2.6.

* Due to the extremely laborious installation of RDoc,gem install rails --no-ri --no-rdoc 可以跳过。

5, because before my computer has been installed apache2, so no longer install Nginx, directly with Apache2 to do the deployment. Nginx Deployment Scenarios

The first is to install the passenger plug-in, passenger is a gem package, the installation command is the gem install passenger, then is prompted to the Apache loading module, restart Apache2.

In addition, the deployment of the time to add a line under the DC: railsenv Development, the other and PHP is the same.

* Deployment Section Reference: http://binku.iteye.com/blog/483687

http://www.iteye.com/problems/21120

6. Special Tips

1) Ubuntu under the JS environment needs to edit gemfile, the first line, modify the source of the domestic; after canceling the JS environment before the comments, run the bundle install, then start rails s to browse.

2) You can also directly use Rails s-b 192.168.2.7来 start the debug server, and then win the next access http://192.168.2.7:3000

The process of deploying to Apache is more tortuous:

1, passenger directly after installation: Apt-get install APACHE2, gem install passenger, Passenger-install-apache2-module cannot find the command Gemfile in the application, add the bundle install, and then you can continue to add the contents of the hint file apache2.conf finally.

2, establish the virtual host, and specify the domain name.

3, when the visit prompt:

  

In fact, in the development environment, RAILS_ENV can be set to develop: railsenv development

http://blog.csdn.net/abbuggy/article/details/8245941

The rails development environment under Ubuntu 14.04

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.