Tested & worked for Magento 2.4.*
Algorythm for Ubuntu
1) cd [MAGENTO_ROOT]/vendor/magento/theme-frontend-luma/Magento_Catalog/layout
2) nano default.xml
3) Add the following code at the end of xml doc before
tag:
<referenceBlock name="catalog.compare.link" remove="true" /> <referenceBlock name="catalog.compare.sidebar" remove="true" /> <referenceBlock name="catalogsearch.product.addto.compare" remove="true" /> <referenceBlock name="category.product.addto.compare" remove="true" /> <referenceBlock name="crosssell.product.addto.compare" remove="true" /> <referenceBlock name="related.product.addto.compare" remove="true" /> <referenceBlock name="upsell.product.addto.compare" remove="true" /> <referenceBlock name="view.addto.compare" remove="true" />
4)launch bin/magento c:c & bin/magento c:f
gsettings set org.gnome.shell.extensions.dash-to-dock click-action 'minimize'
Step 1: Go to
~/.config/deepin/deepin-terminal/and open
config.conf
Step 2:
Find section
run_as_login_shell=falsein config file
Step 3:
Change flag run_as_login_shell into true
Step 4:
Reload Deepin Terminal
rvm install ruby-2.1.1
Searching for binary rubies, this might take some time. No binary rubies available for: ubuntu/17.04/x86_64/ruby-2.1.1. Continuing with compilation. Please read 'rvm help mount' to get more information on binary rubies. Checking requirements for ubuntu. Installing requirements for ubuntu. Updating system.......There has been an error while updating your system using `apt-get`. .....It seems that there are some 404 Not Found errors for repositories listed in: /etc/apt/sources.list /etc/apt/sources.list.d/*.list Make sure that all repositories are available from your system and verify your setup by running manually: sudo apt-get update Make sure that it works correctly before proceeding with RVM. If you are working from the GUI instead of the terminal, you might want to verify and fix broken repositories using "Software & Updates" application. . Error running 'requirements_debian_update_system ruby-2.1.1', please read /home/home-pc/.rvm/log/1514552025_ruby-2.1.1/update_system.log Requirements installation failed with status: 100.
rvm get head
rvm reload
rvm install ruby-2.1.1
class Image < ActiveRecord::Base has_attached_file :file, styles: { thumb: {processors: [:image_thumb]}} validates_attachment_content_type :file, content_type: ["image/jpg", "image/jpeg", "image/png", "image/gif", "image/svg+xml"] attr_accessor :tmp_stage_file_name attr_accessor :tmp_stage_file_ext before_post_process :save_staged_file after_save :replace_original_file def save_staged_file if (path = file.staged_path) if (file.content_type == 'image/svg+xml') @tmp_stage_file_name = File.join("/tmp", SecureRandom.uuid) @tmp_stage_file_ext = File.extname(path) FileUtils.cp(path, File.join("/tmp", "#{tmp_stage_file_name}#{tmp_stage_file_ext}")) end end end def replace_original_file if !file.blank? && !tmp_stage_file_name.blank? path = File.join("/tmp", "#{tmp_stage_file_name}#{tmp_stage_file_ext}") if File.exist? path FileUtils.cp path, file.path FileUtils.rm path, force: true end end @tmp_stage_file_name = nil @tmp_stage_file_ext = nil end endImage Processor
lib/paperclip_processors/image_thumb.rb
module Paperclip class ImageThumb < Processor HEIGHT = 320 WIDTH = 320 def initialize file, options = {}, attachment = nil super @file = file @instance = options[:instance] @current_format = File.extname(@file.path) @whiny = options[:whiny].nil? ? true : options[:whiny] @basename = File.basename(file.path, File.extname(file.path)) @geometry = options[:geometry] end def make geometry = Paperclip::Geometry.from_file(@file) filename = [@basename, @current_format || ''].join dst = TempfileFactory.new.generate(filename) begin cmd = file.content_type != 'image/svg+xml' ? %Q(convert '#{file.path}' -resize '#{WIDTH}x#{HEIGHT}^' -gravity 'center' -crop '#{WIDTH}x#{HEIGHT}+0+0' +repage '#{dst.path}') : %Q(rsvg-convert -a -w #{WIDTH} -h #{HEIGHT} -f svg '#{file.path}' -o '#{dst.path}') Paperclip.run(cmd) rescue raise Paperclip::Error, "There was an error processing the thumbnail for #{@basename}" if @whiny end dst end end end
sudo apt get install rsvg-convertin order to add support for scalable vector graphics.
sudo apt get install librsvg2-bin
Delayed::Job.find(1).invoke_job