First, the introduction
Ruby on Rails is just a factor in making Ruby great, as EJB is just one part of the Java Enterprise platform. This article will bring you together as a Java developer, leveraging only the functionality that Ruby itself can
A running program often encounters unexpected problems. A file to read does not exist; When you want to save some data, the disk is full; The user may enter inappropriate data.
ruby> file = open ("Some_file")
ERR: (eval): 1:in ' open ': No such
A constant begins with a capital letter. It should be assigned up to one time. In the current version of Ruby, the re-assignment of constants produces only warnings rather than errors (the Non-ansi version of EVAL.RB does not report this warning)
A module is similar to a class, and it can also be said to be "a class that cannot be instantiated." Because class classes are subclasses of the module class, it might be better to say "class = module + instantiation capability."
What is the
BlockDefined
Some_array.each {|value| puts value + 3}
sum = 0
other_array.each do |value|
Sum + = value
puts value/sum end
A block are somewhat like the "Body of" anonymous method
Block can take parameters
Block only
First, the number
Ruby supports integers and floating-point numbers, and integers can be arbitrary lengths
A range of integers are stored in binary, they belong to the Fixnum type, and are automatically converted to the Bignum type when
Write one of the simplest examples
1. Build the following folder
Note: The Lib directory must have a RB file that is the same as your gem name.
Copy Code code as follows:
$ CD Hola
$ tree
.
├──hola.gemspec
└──lib
└──hola.
In this chapter I have met the C-language struct data, which is the custom data structure. Like what:struct Edge{int u;int V;int W;};The topic gives a set of data that is stored with the edge. You need to sort by the W size. I didn't know how to do
Use Fastlane for fast, continuous updates and a range of issues during installation:1. Installing the Fastlane:sudo gem install FastlaneErrorERROR: Failed to build gem native extension.--remove http://rubygems.org/-a https://ruby.taobao.org/# View
Ruby on Rails Twitter ApplicationProgramThe interface is very simple.Twitter is a simple rails application.The application interface for querying information is called as a GET request, while the application interface for modifying, creating,
1. Check whether Ruby-debug-Ide is installed.
$ Gem list
2. If not, install ruby-debug-ide
$ Gem install ruby-debug-ide
3. Open your project in Aptana Studio 3 and enable the debug server: app Explorer-> gear drop-down menu-> debug Server
4.set
I. Railway
1.1 create a rails Application
Program
$ Rails app_name
Optional:
-D, database = xxx specifies to install a database (MySQL Oracle PostgreSQL sqlite2 sqlite3), which is a database by default
-R, ruby-Path = specifies the ruby
Build Ruby on Rails in Ubuntu
Ruby on Rails is an open-source Web framework written in ruby., Similar to J2EE and PHP. Ruby on Rails is a very beautiful web development framework and incorporates the essence of agile development:Conventions
Like most object-oriented languages, Ruby classes allow class variables and methods to be defined. A class variable allows a single variable to be shared among all instances of a class. In Ruby, two @ signs are used to indicate class variables. For
A concise tutorial on Ruby and Ruby on Rails framework Environment setup, rubyrails
Install Ruby and upgrade RubyGemsTip: During the installation process in Ubuntu, if a permission error is prompted, you can use sudo make and sudo make install.
1.
Ruby-v # view the ruby VERSION ruby-e '''require "watir"; puts Watir: IE: version'' # view the watir VERSION
Rvm list known # list known ruby versions
Rvm install 1.9.3
Rvm use 1.9.3 | rvm use system
Rvm use 1.9.3 -- default
Rvm list # list local
Ruby is filled with a series of hidden variables. We can get some interesting information from these predefined global variables.
Global process variable
$ Indicates the currently running ruby process.Copy codeThe Code is as follows: >>$ $=> 17170We
The debate On Ruby On Rails in the Java Community is already fierce and there will be no signs of stopping in the future. Rails Supporters praised it for its amazing efficiency, which is about compared with Java development. As a Java programmer,
Why is Ruby a shining pearl in developers' resumes?
Over the past five years, the overall demand for Ruby on Rails skills has quadrupled. According to a survey by PayScale, an online compensation, benefits, and allowances company, Ruby has become
Over the past few days, I 've talked about a lot of things about Ruby. To sum up, I wrote this blog.
At the beginning of this year, I plan to thoroughly experience Ruby on rails. For me, I have not been familiar with "new language" for many years.
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