Rails server automatically stop when using cloudinary API
Hi, I have installed cloudinary gem v1.13.2 in my local rail server. I have put cloudinary.yml file in the config folder. Yet, I have major problem.
When I try to called out any of the cloudinary API, my server automatically stopped. Then, I need to delete the server temp file before I can start the server again.
Kindly to help.
-
Can you please provide us details to the error message that you see?
0 -
My server console do not give any errors. It just stop suddenly. Below is the code that I use in my controller:
def template
result = Cloudinary::Uploader.destroy('SampleId')
if result
redirect_to page_settings_path, notice: "[EVENT] Image deleted!"
else
redirect_to page_settings_path, alert: "[EVENT] Image cannot be deleted!"
end
endI just want to delete the uploaded image from my cloudinary account. The API works. My "SampleId" image is being deleted. But my local rail server suddenly stopped.
What may cause it?
0 -
Hi Muhammad,
It's difficult to say yet with certainty what can cause this.
What are the last things that are printed in the logs before the server stops?
What versions of Rails and Ruby are you running?
Do you have other dependencies in your project, can you reproduce it in a new rails app with only Cloudinary?0 -
There is no errors printed. The server just stop. I'm using Ruby 2.5.1 and Rails 5.2.0 for my project.
0 -
Hi Muhammad,
Looking at your account's logs, I see five calls to the destroy API, all of which are with status 200.
April 18th 2020, 14:54:06.087 200
April 18th 2020, 02:04:42.308 200
April 18th 2020, 01:22:51.966 200
April 17th 2020, 07:07:54.101 200
April 17th 2020, 06:50:50.339 200I, therefore, assume you're experiencing a local environment issue. If you'd share the last few lines of your server logs that lead to the shutdown, we might be able to investigate it further.
Thanks,
Roee0 -
Yes, I can delete the image. Yet, my server suddenly stop without any logs. It just hang for a few moment and then stop. Is there any mistakes on how I configured my cloudinary gem?
I have tested that this commands work when using in .html.erb file:
<!-- Display image -->
<%= cl_image_tag("sample") %>
<!-- Display image with specify size -->
<%= cl_image_tag("sample", :width=>150, :height=>210) %>
<!-- Display image Url -->
<%= cloudinary_url("sample") %>Yet, still no success when using cloudinary API in the controller. Not sure what the problem. The API works but the server stop suddenly with no errors log.
Any helps via TeamViewer is really appreciate. You can see the errors in action.
0 -
Hi Muhammad,
Could you please raise a ticket with us at - https://support.cloudinary.com/hc/en-us/requests/new - so that we can schedule a screen share via Zoom?
In the meantime, could you please try this with a new rails app that has no other dependencies apart from Cloudinary?
0 -
After vigorous testing for 5 days, I managed to fix the problem. LOL. It may because of this 4 below gems:
byebug
capybara (>= 2.15, < 4.0)
chromedriver-helper
selenium-webdriverMaybe it cause conflict with cloudinary gem. I'm not sure. But what I did is just remove them because I don't use it in my project. Then, deleted the gemfile.lock from app folder. Next, run again 'bundle install' command. This fix the problem, server being exited or stopped suddenly without any errors log when using cloudinary API.
By the way, many thanks for your help especially Daniel Mendoza, Aleksandar Kostadinov and Roee Ben Ari. Thank you for wonderful gem for rails ruby. Yet, you may want to test why above 4 gems cause problem with cloudinary gem.
0
Post is closed for comments.
Comments
8 comments