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.
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.
brew install shared-mime-info
bundle install
These two commands fixed the issue for me.
fissh
These two commands fixed the issue for me.
brew install shared-mime-info
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
Try deleting this file from the system
/home/darkpasenger/.rbenv/versions/2.1.5/lib/ruby/gems/2.1.0/cache/mimemagic-0.3.0.gem
and then try installing the gem again. It seems that the gem was not properly downloaded.
Related
After "bundle install", I keep getting this error for many times.
Errno::EACCES: Permission denied # rb_sysopen - /Users/daisukeishii/tasca- io/vendor/bundle/ruby/2.3.0/gems/pg-0.18.4/.gemtest
An error occurred while installing pg (0.18.4), and Bundler cannot continue.
Make sure that `gem install pg -v '0.18.4'` succeeds before bundling.
gem install pg keeps giving the same error
-ruby 2.3.0p0 (2015-12-25 revision 53290) [x86_64-darwin15]
-psql (PostgreSQL) 9.5.0
-Mac El Capitan
-I checked all related posts in stackoverflow but could not solve this.
Tried to uninstall/install PostgreSQL through brew.
Tried to uninstall/install Ruby
Do you have any idea to solve this?
I had problems installing the pg gem and for me this did the trick:
ARCHFLAGS="-arch x86_64" gem install pg
However, looking at your error message it actually seems to be about not having write permissions to the gem directory. Maybe you have tried to install the gem as root with sudo gem install pg and it left behind a directory under your home directory having root as owner instead of your regular user.
Remove the directory using:
sudo rm -rf /Users/daisukeishii/tascaio/vendor/bundle/ruby/2.3.0/gems/pg-0.18.4
And then try installing again using the ARCHFLAGS above.
Note that your post has some sort of copy paste problem in the path so the path in this example might not be correct.
In my case, the pg gem was looking for a PostgreSQL installation in the wrong place, so I runned
bundle config build.pg --with-pg-config=/usr/local/Cellar/postgresql/9.4.5/bin/pg_config
which was where my PostgreSQL installation actually was, and then
bundle install
I was installing locamotive's CMS, and this problem happens..
Let me know how can I solve it.
Minis-MacBook-Air:~ daraotsu$ cd myapp
Minis-MacBook-Air:myapp daraotsu$ bundle install
Fetching gem metadata from http://rubygems.org/........
Fetching gem metadata from http://rubygems.org/..
Resolving dependencies...
Installing rmagick (2.12.2)
Errno::EACCES: Permission denied - /Users/daraotsu/.rvm/gems/ruby-2.0.0-p0/gems/rmagick-
2.12.2/README.html
An error occurred while installing rmagick (2.12.2), and Bundler cannot
continue.
Make sure that `gem install rmagick -v '2.12.2'` succeeds before bundling.
i would try sudo gem uninstall rmagick -v '2.12.2' then try running your bundle again... if that fails remove /Users/daraotsu/.rvm/gems/ruby-2.0.0-p0/gems/rmagick-
2.12.2 and try to bundle again.
You could try fixing ownership on the .rvm directory with chown -R daraotsu /Users/daraotsu/.rvm, but I'm thinking your best bet is to uninstall and then reinstall RVM and try again. Somehow you managed to install RVM into your home directory without taking ownership of the files.
After run bundle install I get this error:
Gem::Package::FormatError: no metadata found in /Users/jeanosorio/.rvm/gems/ruby-1.9.3-p286/cache/libv8-3.11.8.13-x86_64-darwin-12.gem
An error occurred while installing libv8 (3.11.8.13), and Bundler cannot continue.
Make sure that `gem install libv8 -v '3.11.8.13'` succeeds before bundling.
I try with
gem install libv8 -v '3.11.8.13'
But I get
ERROR: Error installing libv8:
invalid gem format for /Users/jeanosorio/.rvm/gems/ruby-1.9.3-p286/cache/libv8-3.11.8.13-x86_64-darwin-12.gem
What is the problem here. Please some help.
The Gem::Package::FormatError: no metadata found in ... error message indicates that the content of Ruby's cache directory gets out of sync with the actual gem repository.
The error can be fixed by removing either the offending file or the complete cache folder, and running bundle install again.
First try removing the offending file:
rm ~/.rvm/gems/ruby-1.9.3-p286/cache/libv8-3.11.8.13-x86_64-darwin-12.gem
bundle install
That should fix the problem. If it doesn't, remove the complete cache folder:
rm -rf ~/.rvm/gems/ruby-1.9.3-p286/cache/
bundle install
Ref:
Rails: Fixing Bundle “No Metadata Found” issues
Bundler issue : No metadata found
SO answer to RubyGems issue on OSX
Additionally, it might be worth updating rubygems version with gem update --system as mentioned in this answer
When I run gem env, I get the following error:
Error loading RubyGems plugin "/home/chenge/.rvm/gems/ruby-1.9.2-p320#global/gems/rubygems-bundler-0.9.2/lib/rubygems_plugin.rb": undefined method `first' for #<String:0x8ec8670> (NoMethodError)
Could anybody help me to understand what this means? Thanks.
gem clean
Cleaning up installed gems...
Attempting to uninstall rvm-1.11.3.3
Unable to uninstall rvm-1.11.3.3:
Gem::InstallError: gem "rvm" is not installed
Attempting to uninstall rubygems-bundler-0.9.2
Unable to uninstall rubygems-bundler-0.9.2:
Gem::InstallError: gem "rubygems-bundler" is not installed
Attempting to uninstall bundler-1.1.3
Unable to uninstall bundler-1.1.3:
Gem::InstallError: gem "bundler" is not installed
Clean Up Complete
Your rubygems-bundler is out-date(0.9.2), install the latest version(1.1.0) will fix that.
$ gem clean
$ gem install rubygems-bundler
I tried on my EC2 instance, it works.
the problem may be caused by:
incorrectly installed Ruby
incorrectly installed RubyGem
incorrectly installed RVM
I suggest you remove the rubygem entirely. ( rm /home/chenge/.rvm/gems -rf ) and then download the latest rubygem then re-install it.
I created a new RoR application, but whenever I run bundle install (which installs RSpec along other gems) I get the following error:
Gem::Package::FormatError: no metadata found in /Users/petarpetrovic/.rvm/gems/ruby-1.9.3-p194/cache/selenium-webdriver-2.22.0.gem
An error occured while installing selenium-webdriver (2.22.0), and Bundler cannot continue.
Make sure that gem install selenium-webdriver -v '2.22.0' succeeds before bundling.
When I run gem install selenium-webdriver -v '2.22.0', I get the following error message:
ERROR: Error installing selenium-webdriver:
invalid gem format for /Users/petarpetrovic/.rvm/gems/ruby-1.9.3-p194/cache/selenium-webdriver-2.22.0.gem
I tried manually removing the gem from cache folder and then rerun bundle install but I still get the same error messages.
Any ideas how to fix this?
Update gems
gem update --system
gem update
Check Gemfile in your rails application. Should content: gem "selenium-webdriver", "~> 2.22.0"
Run bundle install again.
I don't quite understand the above solution although it might work for someone. I ran into the same error but with different gem. I got problem with nokogiri and got this error message:
Gem::Package::FormatError: no metadata found in /home/myname/.rvm/gems/ruby-1.9.3-p194/cache/nokogiri-1.5.5.gem
I went to /home/myname/.rvm/gems/ruby-1.9.3-p194/cache/ and removed the file nokogiri-1.5.5.gem and I was able to run bundle again. I think there is something messed up with the .gem file.
Remove the cached copy of the gem and then try installing it again
rm -rf /Users/petarpetrovic/.rvm/gems/ruby-1.9.3-p194/cache/selenium-webdriver-2.22.0.gem
gem install selenium-webdriver -v '2.22.0'