Error after removing gem image_processing because using cloudinary as image processor - image-processing

I have just upgraded from rails 6 to rails 7. Started getting errors on heroku related to vips :
LoadError
Could not open library 'vips.so.42': vips.so.42: cannot open shared object file: No such file or directory. (LoadError)
Could not open library 'libvips.so.42': libvips.so.42: cannot open shared object file: No such file or directory
I am actually handling image processing using Cloudinary, so I thought I do not need any image processing gem or library in my app. Thus I just removed the image_processing gem from my gemfile (the one that is using vips apparently).
I now get a new error :
LoadError ActiveStorage::Representations::RedirectController#show
New Issue
Generating image variants require the image_processing gem. Please add `gem 'image_processing', '~> 1.2'` to your Gemfile. (LoadError)
I dont really understand why I am getting this error, does ActiveStorage actually needs image_processing even though I am using it with cloudinary ?

Related

cannot load such file -- google/apis/sheets_v4 (LoadError)

I'm writing an app that accesses and edits google sheets. I have the same code working in a ruby test file, but when I copy the code line for line to the rails model it throws an error: cannot load such file -- google/apis/sheets_v4 (LoadError)
I have made sure to require google/apis/sheets_v4 and that I'm up to date on 'google-api-client' Both of my files are in the same folder, so they should have access to the same libraries.
The only potential source of error that I have so far is that some part of the app relies on a legacy version of google-api-client, so both 0.4.7 and 0.23.3 are installed. Is there a way to force utilization of one over the other?
The app was developed before my arrival at the company, so I don't know the reasoning for the use of a legacy api (yet).
Try the solution from this github forum to use the version you want:
I had to do
gem 'google-api-client', '~> 0.7.1'
then bundle update google-api-client addressable faraday and that let
me figure out which other gems to update for me to be able to use that
newer gem version. Because of dependencies by default bundle was
installing older version for me.

Can't load gem from local path

I'm creating an azure wrapper for dragonfly gem and I've published it in rubygems. Now I'm loading it in the Gemfile of my rails app with:
gem 'dragonfly-azure_data_store',
git: 'https://github.com/meloncargo/dragonfly-azure_data_store.git',
branch: :master
and the gem loads, but as I'm changing it constantly, I've configured bundler to load directly from my path:
bundle config local.dragonfly-azure_data_store /home/alter/workspace/meloncargo/dragonfly-azure_data_store
and when I start the rails app, it throws:
/home/alter/.rvm/gems/ruby-2.4.2#productwatcher/gems/activesupport-5.1.4/lib/active_support/dependencies.rb:292:in
`require': cannot load such file -- dragonfly-azure_data_store
(LoadError)
I've tried setting the gem as a path, without the bundler config:
gem 'dragonfly-azure_data_store',
path: '/home/alter/workspace/meloncargo/dragonfly-azure_data_store'
But I receive the same error. Just for the record, my local gem has the same changes as in master and any change I made locally (example: adding puts 'foo' inside def initialize of the main class), is reflected when I started the rails app, but eventually the error is raised.
Any idea what could be the problem?
I've just realized the problem has to do with I'm using require_reloader gem .
I've created an issue to see what happens with it.
Using a relative path for the argument should work
gem 'dragonfly-azure_data_store', path: '../dragonfly-azure_data_store'
And in your ruby file:
require 'dragonfly'
require 'dragonfly/azure_data_store'

Rails 4 - cannot load such file -- rich (LoadError) - After removing gem from gemfile

I've removed a gem from my gemfile (specifically this gem). I've run bundle update. I can't start the server or migrate db because of this error I now get: /lib/active_support/dependencies.rb:229:in `require': cannot load such file -- rich (LoadError)
I've had trouble removing this gem as well. Simply run a search in your application to find all references to the gem and remove them. Unfortunately I wasn't able to find any other way other than manual removal.

Purpose of the sass-rails gem in rails

What is the purpose of the gem 'sass-rails' that is included by default in the :assets group of a new rails app ?
If I comment out that line I can still use .css.scss files without a problem.
You need it for sass/scss files. Clear your browser cache, clear rails cache (Rails.cache.clear in console), comment out the line, uninstall the gem (all versions), then restart your server. You'll get the following error:
no such file to load -- sass
Uncomment the line for the sass-rails gem, reinstall the gem and restart your server to make it work again.

ActiveMessaging generator problem - doesn't support Rails 3

I have a problem with Activemessaging plugin and rails3 app.
my gemfile is
gem 'sqlite3'
gem 'activemessaging', :git=>'git://github.com/spraints/activemessaging.git'
gem 'stomp'
gem 'daemons'
After that activemessaging folder appeared in vendor
After bundle install I want to create processor with generator
rails generate processor Test
And I see this output:
ActiveMessaging: adapter reliable_msg not loaded: no such file to load -- reliable-msg
ActiveMessaging: adapter wmq not loaded: no such file to load -- wmq/wmq
ActiveMessaging: adapter beanstalk not loaded: no such file to load -- beanstalk-client
ActiveMessaging: no '/home/ruby/myapp/script/config/messaging.rb' file to load
ActiveMessaging: Loading script/app/processors/application.rb
Rails available: Adding dispatcher prepare callback.
ActiveMessaging: no '/home/ruby/myapp/script/config/messaging.rb' file to load
Could not find generator processor.
What did I miss ? What should I do step by step to make it works. Thank you
What guide or blog article are you using for installation?
http://code.google.com/p/activemessaging/wiki/Installation
Their wiki doesn't resemble the steps you're taking to install, since they recommend using it as a plugin.
EDIT:
After looking at their active issues on Google Code, this project doesn't support Rails 3 yet. At least, major features are missing such as all the generators being in the wrong place such that rails generate won't know about them.
If you want to go it on your own, you'll have to do a bunch of manual config:
http://code.google.com/p/activemessaging/wiki/Configuration
use https://github.com/kookster/activemessaging repo in your gemfile
gem 'activemessaging', :git => 'git#github.com:kookster/activemessaging.git'
Then you can use the rails 3 generators of this gem:
rails g active_messaging:install
rails g active_messaging:processor YOUR_PROCESSOR
This will create the config/broker.yml (broker config) and config/messaging.rb (queue config).
Its a very nice gem.
NOTE: Be sure to include the celluloid gem and daemons. In my gemfile:
gem 'stomp'
gem 'celluloid'
gem 'daemons'
Happy coding! .)

Resources