When I run
$ vagrant plugin install vagrant-libvirt
on Ubuntu 14.04 I get following error message:
Installing the 'vagrant-libvirt' plugin. This can take a few minutes...
Bundler, the underlying system Vagrant uses to install plugins,
reported an error. The error is shown below. These errors are usually
caused by misconfigured plugin installations or transient network
issues. The error from Bundler is:
An error occurred while installing rack (2.0.1), and Bundler cannot continue.
Make sure that `gem install rack -v '2.0.1'` succeeds before bundling.
Gem::InstallError: rack requires Ruby version >= 2.2.2.
The version numbers in this error message are a bit misleading thou, because I've got ruby 2.3.3 installed via ppa:brightbox/ruby-ng
$ ruby --version
ruby 2.3.3p222 (2016-11-21 revision 56859) [x86_64-linux-gnu]
Running the gem command from the error message fails because of insufficient privileges:
gem install rack -v '2.0.1'
ERROR: While executing gem ... (Gem::FilePermissionError)
You don't have write permissions for the /var/lib/gems/2.3.0 directory.
As superuser it works fine:
$ sudo gem install rack -v '2.0.1'
Successfully installed rack-2.0.1
Parsing documentation for rack-2.0.1
Done installing documentation for rack after 1 seconds
1 gem installed
Thou running sudo vagrant plugin install vagrant-libvirt still fails with the same error message.
What's going on here? How can in get this to work?
Related
I'm using Ubuntu 16.10 and was updating my Gitlab from 6.8 to 7 and everything went wrong. Now I have removed it and is trying to install a new version but ran into a problem with Ruby.
When I try install it
$ sudo apt install gitlab
I get an error after some time:
Could not find gem 'rails (>= 4.2.7.1, ~> 4.2.7)' in any of the gem sources
listed in your Gemfile.
I have tried to run
$ sudo gem install rails
but this gives me another error:
ERROR: Error installing rails:
activesupport requires Ruby version >= 2.2.2.
I don't know what to do now...
I have started all over... Removed gitlab* and postgresql. Rebooted and installed gitlab again. Now I got another error:
Could not find gem 'pg (~> 0.18.2)' in any of the gem sources listed in your Gemfile.
Tried to install pg manually:
$ sudo gem install pg
Successfully installed pg-0.20.0
But still sudo apt upgrade gives the same error: "Could not find gem 'pg'
You may be missing a hidden dependency. Try the following:
sudo apt-get install libpq-dev
I gave up! I reinstalled the Linux server with the Linux LTS version and used the Omnibus package installation..
Problem solved!
I am unable to install vagrant-vbguest on OS X 10.10.4, because it says it can't install Nokogiri.
I have:
ruby 2.0.0p481 (2014-05-08 revision 45883) [universal.x86_64-darwin14]
Vagrant 1.6.2
VirtualBox 4.3.12
The maddening thing is that I do have nokogiri installed already:
> whereis nokogiri
/usr/bin/nokogiri
> /usr/bin/nokogiri -v
# Nokogiri (1.6.6.2)
---
warnings: []
nokogiri: 1.6.6.2
ruby:
version: 2.0.0
platform: universal.x86_64-darwin14
description: ruby 2.0.0p481 (2014-05-08 revision 45883) [universal.x86_64-darwin14]
engine: ruby
libxml:
binding: extension
source: packaged
libxml2_path: /Library/Ruby/Gems/2.0.0/gems/nokogiri-1.6.6.2/ports/x86_64-apple-darwin14/libxml2/2.9.2
libxslt_path: /Library/Ruby/Gems/2.0.0/gems/nokogiri-1.6.6.2/ports/x86_64-apple-darwin14/libxslt/1.1.28
libxml2_patches:
- 0001-Revert-Missing-initialization-for-the-catalog-module.patch
- 0002-Fix-missing-entities-after-CVE-2014-3660-fix.patch
libxslt_patches:
- 0001-Adding-doc-update-related-to-1.1.28.patch
- 0002-Fix-a-couple-of-places-where-f-printf-parameters-wer.patch
- 0003-Initialize-pseudo-random-number-generator-with-curre.patch
- 0004-EXSLT-function-str-replace-is-broken-as-is.patch
- 0006-Fix-str-padding-to-work-with-UTF-8-strings.patch
- 0007-Separate-function-for-predicate-matching-in-patterns.patch
- 0008-Fix-direct-pattern-matching.patch
- 0009-Fix-certain-patterns-with-predicates.patch
- 0010-Fix-handling-of-UTF-8-strings-in-EXSLT-crypto-module.patch
- 0013-Memory-leak-in-xsltCompileIdKeyPattern-error-path.patch
- 0014-Fix-for-bug-436589.patch
- 0015-Fix-mkdir-for-mingw.patch
compiled: 2.9.2
loaded: 2.9.2
And I can reinstall it individually:
> sudo gem install nokogiri -v '1.6.6.2'
Building native extensions. This could take a while...
Successfully installed nokogiri-1.6.6.2
1 gem installed
And yet:
> sudo vagrant plugin install vagrant-vbguest
Installing the 'vagrant-vbguest' plugin. This can take a few minutes...
Bundler, the underlying system Vagrant uses to install plugins,
reported an error. The error is shown below. These errors are usually
caused by misconfigured plugin installations or transient network
issues. The error from Bundler is:
An error occurred while installing nokogiri (1.6.6.2), and Bundler cannot continue.
Make sure that `gem install nokogiri -v '1.6.6.2'` succeeds before bundling.
Also:
> vagrant plugin update
Updating installed plugins...
Bundler, the underlying system Vagrant uses to install plugins,
reported an error. The error is shown below. These errors are usually
caused by misconfigured plugin installations or transient network
issues. The error from Bundler is:
An error occurred while installing nokogiri (1.6.6.2), and Bundler cannot continue.
Make sure that `gem install nokogiri -v '1.6.6.2'` succeeds before bundling.
It does look like the problem has nothing to do with nokogiri, but I was not able to find a solution.
Any ideas?
This question is quite old, but searchable. Vagrant is pluggable, and I expect it embeds Ruby, instead of working with the system Ruby you might use for scripting.
You shouldn't have to worry about Ruby gems anyway because you can install plugins right from your Vagrantfile:
# Install required plugins
required_plugins = %w( vagrant-vbguest )
plugin_installed = false
required_plugins.each do |plugin|
unless Vagrant.has_plugin?(plugin)
system "vagrant plugin install #{plugin}"
plugin_installed = true
end
end
I can't install latest Compass 1.0.1 on Ubuntu 14.04.
$ ruby --version
ruby 2.0.0p384 (2014-01-12) [i386-linux-gnu]
$ gem --version
2.0.14
I'm doing:
$ sudo gem install compass -v 1.0.1
The first error in the log is this:
ERROR: Error installing compass:
ERROR: Failed to build gem native extension.
And here's the full log:
https://gist.github.com/slavafomin/055394e379e8252bab9e
I'm installing Ruby via this packages:
ruby2.0
ruby2.0-dev
I even tried to install Ruby via RVM, but I'm getting the same error.
What could be the problem?
Is it possible to install latest version of Compass on Ubuntu 14.04 without RVM?
It looks like problem is actually with ffi extension.
When I've tried to install ffi manually with this command: sudo gem install ffi, it failed with the same error as above. However, when I've specified latest stable version like this: sudo gem install ffi -v 1.9.6 it installed correctly. After that Compass installed like a charm.
I will leave it here if someone will encounter this problem in the future.
Also, this Q/A could be useful:
ERROR: Error installing ffi: ERROR: Failed to build gem native extension
I've posted an issue on FFI's GitHub repository:
https://github.com/ffi/ffi/issues/414
I'm trying to install Vagrant 1.0.4 with gem but it's not working for me and I can't think of a fix. I enter this prompt and I get the following message:
gem install vagrant -v 1.0.4
Building native extensions. This could take a while...
ERROR: Error installing vagrant:
ERROR: Failed to build gem native extension.
I am restricted to using Ruby 1.8.7 in this environment, and also Vagrant 1.0.4.
The log is huge so I'm putting it on Pastebin.
Thanks.
Here is the error message:
Gem::Installer::ExtensionBuildError: ERROR: Failed to build gem native extension.
/usr/local/bin/ruby extconf.rb
Gem files will remain installed in /var/www/app_dir/shared/bundle/ruby/1.8/gems/bson_ext-1.7.0 for inspection.
Results logged to /var/www/app_dir/shared/bundle/ruby/1.8/gems/bson_ext-1.7.0/ext/cbson/gem_make.out
An error occured while installing bson_ext (1.7.0), and Bundler cannot continue.
Make sure that `gem install bson_ext -v '1.7.0'` succeeds before bundling.
I tried running gem install bson_ext -v '1.7.0' and this succeeded with no errors. I've tried installing ruby-dev and ruby1.8-dev apt packages and this did not help.
bundle install is able to successfully build bson_ext on my Mac OS X development system but is failing in the Linux production environment even when I run it directly outside of the context of the capistrano bundle:install task.
I have also tried running gem update --system and gem update bundler and this didn't help.
I suspect the issue lies in how bundle install is called on the target system. Still, I tried updating Capistrano to version 2.13.5 and this did not help.
So, it appears that bundler 1.2.1 is is unable to build the following gems on my system:
bson_ext 1.7.0
curb 0.8.3
nokogiri 1.5.5
json 1.7.5
therubyracer 0.8.2.
I was able to build these using gem install <GEMNAME> -v '<VERSION>' --install-dir /var/www/<APP_DIR>/shared/bundle/ruby/1.8/. After this, running bundle exec capistrano deploy succeeded.
bundle does not appear to be able to build gems with native extensions on my system. Not sure why, but maybe this procedure will help those with a similar issue.