Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Error while installing the mimemagic in rails

I am using rails 4.2.4 and try to install paperclip gem in my application. After editing my gem file when I run bundle install.Then I got the error.

Bundler::GemspecError: Could not read gem at /home/darkpasenger/.rbenv/versions/2.1.5/lib/ruby/gems/2.1.0/cache/mimemagic-0.3.0.gem. It may be corrupted.

An error occurred while installing mimemagic (0.3.0), and Bundler cannot continue.

Make sure that gem install mimemagic -v '0.3.0' succeeds before bundling.

So I run the command gem install mimemagic -v '0.3.0.Then again I got the error.

ERROR:  Error installing mimemagic:
invalid gem: package is corrupt, exception while verifying: undefined method `size' for nil:NilClass (NoMethodError) in /home/darkpasenger/.rbenv/versions/2.1.5/lib/ruby/gems/2.1.0/cache/mimemagic-0.3.0.gem

Please help me out to fix this problem.

like image 986
drakpasanger Avatar asked Nov 27 '15 20:11

drakpasanger


2 Answers

I found the answer here: https://programmerah.com/mimemagic-0-3-10-install-error-and-bundler-cannot-continue-26830/

but I have pasted the steps in case the link stops working.

  1. brew install shared-mime-info
  2. bundle install

These two commands fixed the issue for me.

fissh

like image 145
gadildafissh Avatar answered Sep 21 '22 19:09

gadildafissh


These two commands fixed the issue for me.

  1. brew install shared-mime-info
  2. bundle install

But i need to run first this command sudo chown -R $(whoami) $(brew --prefix)/* because brew install shared-mime-info is failed in my system with the error permission denied @rb_file_s_symlink

like image 41
Vipul Avatar answered Sep 21 '22 19:09

Vipul