Failed to Install Compass 1.0.1 on Ubuntu 14.04 - ruby

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

Related

Gitlab installation - Ruby rail error

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!

Unable to install bcrypt-ruby, blocks upgrade of devise, "Failed to build native gem extension"

I'm on Mac OSX 10.10.2. In attempting to upgrade devise from 2.1.2 to 2.2.8 (by updating the version in the Gemfile), bundle install attempts to install bcrypt 3.1.10 and crashes with this output:
/Users/username/.rvm/rubies/ruby-1.9.3-p547/bin/ruby extconf.rb
creating Makefile
make clean
make
compiling bcrypt_ext.c
make: *** [bcrypt_ext.o] Segmentation fault: 11
make failed, exit code 2
I have attempted some fixes found in searching, such as:
`gem install bcrypt -v '3.1.10'ยด
(same error)
Download gem source from github (https://github.com/codahale/bcrypt-ruby) and attempt to install from the local gemfile (same error).
Uninstall bcrypt-ruby with gem uni bcrypt, reinstalling with gem i bcrypt-ruby --platform=ruby (same error)
If I set user to root with sudo su -, I am able to run the install with the following output:
root# gem install bcrypt -v '3.1.10'
Building native extensions. This could take a while...
Successfully installed bcrypt-3.1.10
Parsing documentation for bcrypt-3.1.10
unable to convert "\xCA" from ASCII-8BIT to UTF-8 for lib/bcrypt_ext.bundle, skipping
1 gem installed
However, if I exit out of root, bundle install still fails.
Running rvm 1.25.3, ruby 1.9.3, gem 2.2.2, Bundler version 1.9.4, Xcode 6.3, Command Line Tools 6.3
Any ideas?
Finally, this worked:
Updating RVM to head with rvm get head
Uninstall rvm 1.9.3 with rvm uninstall 1.9.3
Re-install rvm 1.9.3. Tried running rvm install 1.9.3, which advised to run rvm install ruby-1.9.3-p551 instead. Did that.
rvm use 1.9.3
Reinstalled bundler with gem install bundler
Now, finally bundle install works.
It seems likely that previous steps (particularly running updates on Xcode & Command Line Tools) have contributed to success.

vagrant 1.6.3 unable to install berkshelf 2.0.1 on mac osx

I'm facing this issue running
vagrant plugin install vagrant-berkshelf --plugin-version ">= 2.0.1"
I get this error
An error occurred while installing dep_selector (1.0.3), and Bundler
cannot continue. Make sure that gem install dep_selector -v '1.0.3'
succeeds before bundling.
I've seen mention of this issue including workarounds for Ubuntu, however I cannot find a workaround for mac OSX
https://github.com/berkshelf/vagrant-berkshelf/issues/191
https://github.com/berkshelf/berkshelf/issues/1138
Has anyone gotten around this on OSX?
From https://github.com/opscode/dep-selector/issues/28 I was able to get past this error with:
GEM_PATH=~/.vagrant.d/gems GEM_HOME=~/.vagrant.d/gems /Applications/Vagrant/embedded/bin/gem install dep_selector -v '1.0.3'
However there is also https://github.com/berkshelf/vagrant-berkshelf/issues/209
GEM_HOME=~/.vagrant.d/gems gem install dep_selector -v '1.0.3'
Which I assume may also work.
Unsure if the below played into this working for me (installing gecode from brew).
One of the issues you listed, links to: https://github.com/opscode/dep-selector-libgecode/issues/15
gem uninstall dep-selector-libgecode
gem uninstall dep_selector
USE_SYSTEM_GECODE=1 gem install dep-selector-libgecode
gem install dep_selector
This will fail... but the error message has this:
cd $( brew --prefix )
git checkout 3c5ca25 Library/Formula/gecode.rb
brew install gecode
I also did these steps as I was trying to solve this.
Time for all of us to move to Mavericks for ChefDK :)

ERROR: Error installing jekyll: ERROR: Failed to build gem native extension

My system has:
ruby 2.0.0p451 (2014-02-24) [x64-mingw32]
gem -version 2.2.2
devKit : DevKit-mingw64-64-4.7.2-20130224-1432-sfx.exe
When I try to run gem install jekyll, I get this error:
D:\devKit>gem install jekyll
Temporarily enhancing PATH to include DevKit...
Building native extensions. This could take a while...
ERROR: Error installing jekyll:
ERROR: Failed to build gem native extension.
"D:/Program Files (x86)/Ruby200-x64/bin/ruby.exe" extconf.rb
D:/Program Files (x86)/Ruby200-x64/bin/ruby.exe: invalid switch in RUBYOPT: -F (
RuntimeError)
extconf failed, exit code 1
Gem files will remain installed in D:/Program Files (x86)/Ruby200-x64/lib/ruby/g
ems/2.0.0/gems/fast-stemmer-1.0.2 for inspection.
Results logged to D:/Program Files (x86)/Ruby200-x64/lib/ruby/gems/2.0.0/extensi
ons/x64-mingw32/2.0.0/fast-stemmer-1.0.2/gem_make.out
I got this error while installing Jekyll on Linux (Mint 17, which is based on Ubuntu 14.04).
I eventually found the solution here. I needed both the ruby-dev package and nodejs (the latter due to a bug in Jekyll).
sudo apt-get install ruby ruby-dev make
sudo gem install jekyll --no-rdoc --no-ri
sudo apt-get install nodejs
I ran into this problem too. Running the following installed Jekyll for me:
$ \curl -L https://get.rvm.io | bash -s stable --rails --autolibs=enabled
$ sudo gem install jekyll
This installs RVM, updates Rails and installs Jekyll.
BTW - Most of the posts I've found indicate it's a problem with Xcode not having the developer tools installed. I have a newer MacBook Pro on which this stuff was installed by default, so attempting to install the Xcode dev tools did nothing for me (unlike the above, which did everything I needed).
try
gem update
then
gem install jekyll
And you may want to try with Ruby 1.9.3 and compatible DevKit.

bson_ext 1.7.0 fails to build on Linux when using bundle:install Capistrano task

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.

Resources