Currently, the two most popular Image Upload extensions on rails are fleximage and paperclip. If you only process images in one breath, it is fleximage, of course, but if you still need other MP3, FLV, and other attachments for multi-State Association, then select paperclip. In general, paperclip is much better than the older upload plug-ins, such as acts_as_atta
0 preface files uploaded by paperclip are stored in the public directory of the rails project by default. That is to say, if you can get the URL of the file, you can directly access/download the file, if you want to add access control to the file, you need to change the default upload location of paperclip. 1. Change the default upload position of paperclip. If t
Rake Gems: Build # Build any native extensions for unpacked gems
Rake Gems: Build: Force # Force the build of all gems
Rake Gems: Install # installs all required gems.
Rake Gems: Refresh_specs # Regenerate gem specifications in correct format.
Rake Gems: Unpack # unpacks all required gems into vendor/gems.
Rake Gems: Unpack:d ependencies # unpacks all required gems and their dependencie
When rails 3.0 was released, many of them worried about installing the gem, which was too slow to download the gem. This is not a slow network speed. Ruby's net: HTTP must pass through the wall and go through the sea to reach the rubyforge server. Even if the network environment is very good, the maximum speed is 50 K. What's more, there is no progress bar. Installing a
Proficiency in the use of RubyGemsRubyGems is a Ruby plug-in management system that allows you to easily install and manage Ruby library functions. All open source kits can be found on the rubygems.
# # #常见指令
Gem-v View the version of RubyGems
Gem Update--system upgrade RubyGems version
Gem install gem_name Install a plugin
The specific process is as follows:
1. After the InstantRails-2.0 is installed, configure the ruby/bin directory in the environment variable path (if there are multiple Ruby in the system, the system recognizes the path when executing the command line)
2. Enter the doscommand line and execute gem update -- system. The result is:
Updating rubygems...Error: While executing gem... (
Because the host environment can not be linked to the network, sad, so only to find ways to download the package, upload to the host to installEnvironment: el6.x86_641. Gem installation [http://centos.ustc.edu.cn/centos/6/os/x86_64/Packages/]Ruby 1.9. Version 2 has the Ruby Gem installed by default, if your version is lower than this? Well, then look down.Installing GEMS requires ruby version at 1.8.7# Rpm-
Under the Ubuntu system, the Ruby development environment is installed first through the command sudo apt-get install Ruby, and then with the command-line gem install Jekyll install the GitHub page's development tool Jekyll, encountered an error message: Failed to build gem native extension details are as follows:
Error: Error installing Jekyll:
error:failed to build
After building the Ruby on Rails environment, running the bundle command in a new project encounters the following error:Workaround: Install DevkitTo rubyinstaller website download page Select the Devkit download for your system (here I downloaded the last one):When the download is complete, double-click devkit-mingw64-64-4.7.2-20130224-1432-sfx.exe:Set the extracted folder (for example, C:\DevKit), after decompression to see, the contents of the folder below:Enter the directory on the command l
Curl official download http://curl.haxx.se/download.html
First download the tool from curl, remember to download the tool on the windows platform, select the version that supports SSH2 and SSL protocols, so that you can support the gem download methods for these two protocols, if errors are used during use, download all other attachments on the page.
Note: curl is a command line download tool that supports
Cocould not find gem 'sqlite3 (> = 0) 'in any of the gem sources listed in you r Gemfile, sqlite3gemfileSolution: sudo gem install sqlite3-rubyERROR: cocould not find a valid gem 'rdiscount' (> = 0) in any repository
This problem happened to me for three nights. I have read the official English documents, wiki, and go
When your use gem is the install package, the Result:ERROR:While executing gem ... (Encoding::undefinedconversionerror)U+7CFB to IBM437 in conversion from Utf-16le to UTF-8 to IBM437Workaround:Go to local path to modify the code, so the hint is due to inconsistent coding.To modify the encoding in the registry file:There will be no problem after the change.Error:while Executing
Ruby Gem command and rubygem command
Gem is a standard package for managing Ruby libraries and programs. It is very convenient to find, install, upgrade, and uninstall software packages through Ruby Gem (such as http://rubygems.org/) sources. Ruby Gem is installed in Ruby 1.9.2 by default. If you are u
Transferred from: http://www.jianshu.com/p/728184da1699Gem Introduction:Gem is a standard package for managing Ruby libraries and programs, and it is easy to find, install, upgrade, and uninstall packages through Ruby Gems such as http://rubygems.org/.Ruby 1.9. Version 2 has the Ruby Gem installed by default, and if you are using a different distribution, see "How to Install Ruby Gem".How to install the Rub
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 versions
Rvm remove 1.9.2
For details, see RVM practical guide https://ruby-china.org/wiki/rvm-guide.
Gem-v # gem version
Ruby-v #查看ruby version ruby-e ' require ' watir; Puts Watir::ie::version ' #查看watir版本
RVM list Known #列出已知的ruby版本
RVM Install 1.9.3
RVM Use 1.9.3 | RVM Use System
RVM Use 1.9.3--default
RVM List #列出本地ruby版本
RVM Remove 1.9.2
See RVM Practical Guide for specific details https://ruby-china.org/wiki/rvm-guide
Gem Source #
want to view the help of the install command separately, you can use the NPM helper install--------------------------------------------------------------------------------------------------------Gem-v #gem版本Gem Update #更新所有包Gem Update--system #更新RubyGems软件Gem install Rake #
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
2. Write Code
% Cat lib/hola.rb
puts "Hello world!"
% cat Hola.gemspec
Magic Gem House system development, Magic Gem House source code development, Magic Gem House Consulting: 185,2946,0381 Mr. Chen (micro-electric), Magic Gem House mode development, Magic Gem House app development, Magic Gem House P
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:
and provide relevant evidence. A staff member will contact you within 5 working days.