Build a Ruby environment under Linux Mint 17
Build a Ruby environment under Linux Mint 17
1. Environment Construction
Install curl
Sudo apt-get install curl
Install RVM (Ruby Version Manager)
Curl-sSL https://get.rvm.io | bash-s stable
Install ruby
Rvm install ruby-1.9.3-p545
Install bundler
Gem install bundler
(If You Want To uninstall the app installed with gem, first gem list, and then gem uninstall app_name)
Download a project from github.
Git clone git@github.com: abruzzi/letusgo-server.git
Go to the folder
Cd letusgo-server
Update Project dependencies (the Gemfile. lock file must exist, and bundle install is similar to nodejs's npm install)
Bundle install
So far, the ruby environment has been set up (ps: Sinatra is used for the framework of the project ).
2. Applications
Go to the letusgo-server folder and run
./Setup. sh
If no exception occurs, you will see:
= CreateProducts: migrating ================================================= ============
-- Create_table (: products)
-> 0.0009 s
= CreateProducts: migrated (0.0010 s) ==========================================================
Then run shotgun.
In this case, the server is Enabled:
= Shotgun/WEBrick on http: // 127.0.0.1: 9393/
[20:20:41] INFO WEBrick 1.3.1
[20:20:41] INFO ruby 1.9.3 () [i686-linux]
[20:20:41] INFO WEBrick: HTTPServer # start: pid = 18420 port = 9393
Now, the Sinatra framework has been deployed. You can enter http: // 127.0.0.1: 9393/in the browser.
Tip: The above installation commands do not require sudo. You only need to execute them under the current user.
Iii. References
1. [Sinatra] (http://www.sinatrarb.com/) as Web Server
2. [ActiveRecord] (http://api.rubyonrails.org/classes/ActiveRecord/Base.html) as ORM
3. Sqlite3 as database (single file database)
4. [RSpec] (http://rspec.info/) as unit test framework
5. [Rake] (https://github.com/ruby/rake) as build tools
6. RVM installation instructions
How to traverse objects in a specified directory in Ruby
Build Ruby On Rails in Ubuntu
Build Ruby on Rails on Ubuntu 13.10
Ruby on Rails 4 Tutorial Chinese Version HD complete PDF
Ruby details: click here
Ruby: click here
This article permanently updates the link address: