1. uninitialized constant filecolumn: magick: image:
Cause: rails_file_column and fleximage both exist
Solution: Delete the rails_file_column plug-in. With fleximage, rails_file_column is no longer needed.
2. Add Chinese watermarks to display garbled characters
Reason: rmagick lacks Chinese Fonts
Solution: add the font parameter to the operate function, as shown below:: Font = 'public/images/simsun. TTC'
Note: copy the C:/Windows/fonts/simsun. TTC fi
service
Alternatively, you can set the boot Auto Start site service option in the Help desk in the Windows system
Next, start setting up Apache
ServerName myapp.com
Serveralias www.myapp.com
Proxypass/http://www.myapp.com:8000/
proxypassreverse/http://www.myapp.com:8000
Proxypreservehost on
Leave the request for the static file to Apache for processing because it is better at
Proxypass/images!
Proxypass/stylesheets!
#continue with the othe
Rspec-rails Installing dependent libraries
> VI gemfile:
Gem ' Rspec-rails '
The wording of the specification:
Group:d evelopment,: Test do
...
Gem ' rspec-rails ' ...
End
> bundler Install:
Using Rspec-support 3.5.0
using Rspec-core 3.5.1 using rspec-expectations 3.5.0
using Rspec-mocks 3.5.0
Using rspec-rails 3.5.1
> Rails generate Rspec:install:
Create . RSpec
Create spec
Create spec/spec_helper.rb
Create Spec/rails_ Helper.rb
Generate the RSpec folde
(: Variable,: attribute, options) datetime_select (...) is the date for processing model-related data.
Select_xxx is a normal date (accessed directly through Params)
Why is it useful?Upload files
In form, you need to add: multipart => true. In essence, you can get the data (A stringio) through the corresponding parameters and read the full content to the string, which is equivalent to getting the file content for processing.Error Handling
The
Rails Learning Notes (6) Chinese garbled solution
Environment:。 The MySQL 5.0,mysql environment is configured as UTF8, and the table is all used UTF8.。 IE6.0, FireFox 2.0.2。 Ruby 1.8.5 + Rails 1.2.3
Error behavior:。 Use MySQL Query browser to view MySQL data, the Chinese display is normal.。 The page appears as garbled, the original Chinese place has become a long square。 Manually adjust the browser's page encoding, you can use the normal display of the page. But after the refresh is garbled.Wor
/rubygems/custom_require.rb: 27: in 'gem _ original_require ': no such file to load -- rdoc/rdoc (LoadError)From./lib/rubygems/custom_require.rb: 27: in 'require'From setup. rb: 48Solution: sudo apt-get install-f rdoc
2. the following error occurs when running./script/server:=> Booting WEBrick.../Usr/lib/ruby/gems/1.8/gems/rails-2.0.2/lib/initializer. rb: 159: in 'require _ frameworks': no such file to load
JetbrainsRubymineIt is a good tool for developing rails projects. Here we will briefly introduce the process of using this tool to develop rails projects:
Start rubymine to create a rails Project
Select a rails project:
Select rails in the project attempt framework on the left to View Details:
Create model: Student
Automatically generate the migrate file:
Run the rake task:
Students is automatically generated in Postgres.
Create a
there is no type parameter behind rescue, Ruby uses StandardError as the default value.
System Error
In POSIX systems, errno is a de facto standard. The system or application uses errno to report errors. Ruby wraps these errors into exceptions. These exception classes are derived from SystemCallError. We can see them from the class names, such as Errno: EIO, Errno: EGAAIN, and so on.
The Errno fields of these classes can correspond to the errno values of the system one by one.
Errno: E
UbuntuServerUbuntuServer9.10 latest download: Latest. 2. You can configure the network during installation.
Ubuntu Server
Ubuntu Server 9.10 latest download: http://ubuntu.srt.cn/ubuntu-releases/karmic/ubuntu-9.10-server-i386.iso
1. Install Ubuntu
The installation process is relatively simple. For some new users, I will have an illustration to explain the entire installation process of Ubuntu Server. Please wait for updates.
2. Configure the network
During installation, you can configure t
-click Ruby Installer to a local directory, such as E:/rails/ruby install. One-Click Ruby installeris a set of files that support the rubylanguage. Run this file to install the latest versions of ruby and gem in C:/ruby by default.
(2) Check whether ruby has been installed successfully. Run the ruby-v command in the commond window. If the installation is successful, the following running result is displayed.
C:/Documents and Settings/Administrator> ru
This article comes from: Web development agility-applying rails for agile web development (version 4)
Environment:
Ruby 1.9.3p392 () [i386-mingw32]
Rails 3.2.13
Gem 2.0.3
SQLite
1. Configure the ROS environment in Windows
Use the rubyinstaller installation package. For detailed installation methods, see composer;
2. Hello world!
Run cmd;
Rails news demo
CD demo
Rails s
The above command creates a simple example,
Rails generate controller say hello goodbye // create a
FOR XML PATH Some people may know that some people may not know, in fact, it is the query result set in the form of XML, with which we can simplify our query to implement some of the work that might previously need to be done with the help of a
1. Regardless of 3721, run: sudo apt-get update -- upgrade first.2. Then use rvm for Installation3. if the rvm/rubies/ruby-1.9.3-p0/lib/ruby/1.9.1/yaml appears. rb: 56: in '': If this error occurs, run: sudo apt-get install libyaml-0-2 libyaml-dev --
Use before_invocation to verify the call permission
API
Code highlighting produced by Actipro CodeHighlighter (freeware)http://www.CodeHighlighter.com/-->Class blogapi Api_method: hello_world,
: Expects => [{"password" = >:string}, {"user" =
Based on rails generate generated things, some of the rules of the plural are not understood at first, feel very complex, easy to mistake, hereby recordModelThe actual object of database data, only a single object, such as the model user has a name
Ruby and Java and C ++ have different naming rules for constants, variables, method names, class names, and module names, ruby uses the first letter of a name to differentiate its usage.
1. Local variable: Start with a lowercase letter, for example,
For xml path some people may not know. In fact, it shows the query result set in XML format, with this feature, we can simplify our query statements to implement some work that may previously need to be completed through the function live storage
Rails has a "concise, perfect verification mechanism, extremely powerful expressions and verification frameworks". Section 7.1 of agile web development with rails 4th shows us how to verify product:
Class product true validates: Price,:
File type, C language file read/write, File Buffer, file opening method, file operation functionFile types include stream files and device files. device files such as VGA interfaces, serial ports, USB ports, network ports, and serial ports are abstracted into files by the op
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.