Rails ImageMagic and rmagic - ruby-on-rails

I am following the tutorial http://railscasts.com/episodes/253-carrierwave-file-uploads?view=comments by ryan but he state that we must install imagemagic. so what i have done to install it his has follow
gem "carrierwave"
gem "mini_magick"
gem "rmagick"
in the gemfile. But this still fails when i do bundle. What would be the best way to install it. I am using linux ubuntu and fairly new to it.

You need to install imagemagick on ubuntu then install the rmagick gem.
sudo apt-get install imagemagick libmagickcore-dev libmagickwand-dev

run on linux -
sudo apt-get install imagemagick libmagickcore-dev libmagickwand-dev
sudo gem install rmagick

Related

Rails 6 Active Storage image_processing gem issue

Using Rails 6.0 and 'image_processing', '~> 1.9.3'
When trying to show a cropped variant of an image with:
url_for(user.avatar.variant(crop: crop_geometry)&.processed)
I get an error:
You must have ImageMagick or GraphicsMagick installed
I thought that image_processing gem included any dependencies relatives to this. Should I install some missing dependencies or what? Thanks
It's in the docs, first step, you need to instal dependencies:
https://github.com/janko/image_processing
1. Install ImageMagick and/or libvips:
> $ brew install imagemagick vips
I highly recommend using vips, it's much faster.
You have to install library first.
For Mac user:
brew install imagemagick vips
For debian/ubuntu user:
sudo apt update
sudo apt install imagemagick libvips

tiny_tds gem installation issue on Rails 5

I have tried to install gem tiny_tds on Rails 5, but not able to install. I have googled it and tried all the solution. But there is no solution. Can you please suggest me to install it.
Below are the solutions I have tried,
Rails 4: Error when installing tiny_tds gem?
sudo apt-get install freetds-dev
tiny_tds gem can be easily installed from terminal using following command:
$ gem install tiny_tds
If any other issue you are facing with tiny_tds gem you can refer the documentation of gem:
https://github.com/rails-sqlserver/tiny_tds
Make sure you have freetds library installed in case of MacOS
brew install freetds
Debian 10
Rails: 5.2
Ruby 2.5
How to Install FreeTDS:
source: https://www.microsoft.com/en-us/sql-server/developer-get-started/ruby/ubuntu/
Use the Terminal with Root or Sudo permissions to run the following commands:
wget ftp://ftp.freetds.org/pub/freetds/stable/freetds-1.00.27.tar.gz
tar -xzf freetds-1.00.27.tar.gz
cd freetds-1.00.27
./configure --prefix=/usr/local --with-tdsver=7.3
make
sudo make install
cd ..
gem install tiny_tds
This should get you started.

Rails 4 , ImageMagick and PaperClip

When i want to upload image i get this error:
1 error prohibited this movie from being saved:
Image Could not run the `identify` command. Please install ImageMagick.
I have this in Gemfile:
gem 'imagemagick-identify', '~> 0.0.1'
gem 'paperclip', '~> 4.2.1'
I ran from my console: gem install imagemagick-identify
imagemagick-identify is just a wrapper for imagemagick's identify program. You will need to install imagemagick separately from the gem.
If you are using debian/ubuntu you can do sudo apt-get install imagemagick.
If you are on a Mac, you may find this helpful.
If you are on Windows, you can find binaries to install here.
Looks like there are binaries for other platforms available at the last link as well.
If you have installed imagemagick and still get that error, make sure it is in your PATH.
if you are using cloud 9 ... there may be times just running
sudo apt-get install imagemagick --fix-missing
wont work. If that is your case, do
sudo apt-get update
first then install imagemagick after that

mysql2 gem installation on linux

I am trying to install a gem on linux but it is giving me an error:
An error occured while installing mysql2 (0.3.11), and Bundler cannot continue.
Make sure that gem install mysql2 -v '0.3.11' succeeds before bundling.
What do I need to do now?
Probably, it can't build mysql2 native extension.
If you're using Ubuntu 14.04 or newer, try sudo apt-get install ruby-mysql libmysqlclient-dev.
On older versions of Ubuntu install this: sudo apt-get install libmysql-ruby libmysqlclient-dev
On OS X: brew install mysql
There are also similar questions: 1, 2, 3.
I was using LInux 16 Cinnamon and got that error message. I used "Resure"'s, solution sudo apt-get install libmysql-ruby libmysqlclient-dev
then ran bundle install for project.
It worked!

ImageMagick and Paperclip on Rails only accepts bmp file

I'm trying to set up a rails app with paperclip and ImageMagick on Ubunutu 10.10, I have managed to make it work but only with bmp files, when i try to upload any other kind of file I get the error:
Image Paperclip::CommandNotFoundError
Image Paperclip::CommandNotFoundError
I thought it had something to do with ImageMagic so I found this old tutorial
http://www.randycullom.com/chatterbox/archives/2006/12/installing_imag.html
So I uninstall ImageMagick, installed jpg,tiff and png libraries, on jgp library I used
./configure --enable-shared
...
And then install ImageMagic with configure
./configure --enable-lzw=yes --enable-shared=yes --disable-static --without-perl
make
sudo make install
and the error still apears, on my enviroment.rb I have
Paperclip.options[:command_path] = "/usr/local/bin/"
Which is the path than running 'which convert' gave me, on gem file:
gem "paperclip", "~> 2.3"
gem 'rmagick'
What am I missing? Help would be much appreciated.
On Ubuntu, you can usually safely intall ImageMagick via apt-get (or aptitude). Normally I do:
sudo apt-get install imagemagick
sudo apt-get install libmagick9-dev [deprecated]
sudo gem install rmagick
Edited
use instead of libmagick9-dev
sudo apt-get install graphicsmagick-libmagick-dev-compat
Update from #bartuzz comment
Ubuntu 14.04:
sudo apt-get install libmagickcore-dev libmagickwand-dev
Following on from the other answers (#Callmeed, #arturtr), for Ubuntu 14.04
sudo apt-get install imagemagick
sudo apt-get install graphicsmagick-libmagick-dev-compat
sudo apt-get install libmagickcore-dev libmagickwand-dev
worked for me, but installing rmagick without the sudo
gem install rmagick
Ubuntu 16.04:
sudo apt-get -y install imagemagick libmagickcore-dev libmagickwand-dev

Resources