Ruby standard development environment deployment
Ruby Standard Development Environment Deployment
Ruby standard development environment deployment
! Ruby Standard Development Environment Deployment
weixin_34239169 2014-09-11 19:29:00 ! Ruby standard development environment deployment 73 ! Ruby standard development environment deployment Favorites
[! Ruby standard development environment deployment Python Programming Three Musketeers: Python Programming from Beginning to Practice 2nd Edition + Getting Started Quickly 2nd Edition + Programming for Geeks (Set of 3 Books)* Author: American] Eric Matthes ** Author: Eric Matthes Publisher: People's Posts and Telecommunications Publishing House Reviews: 100.0% Sales: 37 ¥149* more
Ruby environment installation
Sometimes used ruby, so sort out the standard ruby installation process, here does not use the tarball installation, many inconveniences, so such a standard deployment process, has been added to the deployment process, sort out the
Install dependencies
yum groupinstall -y 'development tools'
Install RVM
This total ruby management tool allows you to manage different versions of ruby, as well as install software using ruby sources.
1. curl -L get.rvm.io | bash -s stable
2.
3.
4.
5. source /etc/profile.d/rvm.sh
6. Replace the ruby mirror source
7.
8.
9.
10. sed -i 's!ftp.ruby-lang.org/pub/ruby!ruby.taobao.org/mirrors/ruby!' /usr/local/rvm/config/db
11.
12.
13.
14.
15.
16.
17. 18. rvm list rubies
18. rvm list rubies # List the currently installed versions available on the system.
19.
20.
21. 22. rvm reload #Reread the rvm configuration file.
22. rvm reload #Reread the rvm configuration file.
23.
24.
25.
26. rvm install ruby-2.1.0 #Install the specified ruby version.
27.
28.
29.
30.
31.
32.
33. 34.
34. # Usage: rvm use [version] --default
35.
36.
37. rvm use 2.1.0 --default
38. rvm use 2.1.0 --default
! Ruby standard development environment deployment
gemset
RVM's virtual environment, the concept is similar to virtualenv in python, for details, please move to virtualenv
1. # Usage: rvm gemset [create/use] [name]
2.
3.
4. 5.
5. # Create a new gemset using the default Ruby interpreter (2.1.0)
6.
7.
7. 8.
9. # Run: rvm use [version] if you wish to work with another
10. 11.
11.
12. 13.
13. Create the virtual environment myapp
14.
15.
16.
17. rvm gemset create myapp
18.
19.
20.
21.
22.
23.
24.
25. Using a virtual environment
26.
27.
28.
29. rvm gemset use myapp
30.
31.
32.
33.
34.
35.
36.
37. Creating a virtual environment with the specified ruby version
38.
39.
40.
41. # Usage: rvm use [version]@[name] --create
42. 43.
43.
43. 44.
45. rvm use 2.1.0@myapp --create
46. 47.
47.
48.
49.
50.
51.
52.
53. Emptying the virtual environment
54.
55.
56.
57. # Usage: rvm gemset empty [name]
58.
59.
60.
61. rvm gemset empty myapp
62.
63.
64.
65.
66.
67.
68.
69. Deleting a virtual environment
70.
71.
72.
73. # Usage: rvm gemset delete [name]
74.
75.
76.
77. rvm gemset delete myapp
GEM
Similar to yum under CentOS for installing various Ruby software. This is a tool that requires you to have Ruby installed.
1. gem -v : view version
2.
3.
4.
5. gem update --system : Upgrade the version of RubyGems.
6.
7.
8.
9. gem install gem_name : Installs an application.
10.
11.
12.
13. gem list : Lists the installed applications
14.
15.
16.
17. gem update gem_name: update the specified gem
18.
19.
20.
21. gem update: Updates all the gems you have installed.
22.
23.
24.
25. gem install -v x.x.x gemname : installs a specific version
26.
27.
28.
29. gem uninstall gem_name : Uninstalling a specific version
30.
31.
32.
33.
34.
35.
36. 37.
37. # Domestic environment you know, change to tao's ruby source.
38.
39.
40. 41.
41. $ gem source -r https://rubygems.org/
42.
43.
44. 45.
45. $ gem source -a https://ruby.taobao.org
app
After completing the above steps, you can come directly to the installation of the
1. $ gem install rails
2.
3.
4.
5. Then test that the installation is correct
6.
7.
8.
9.
10.
11.
12.
13. $ rails -v
14.
15.
16.
17. rails 3.2.13