I tried to install susy2 /sass / compass with bundler.
My Gemfile:
source "https://rubygems.org"
gem 'sass', '~> 3.3.2'
gem 'susy', '~> 2.1.1'
gem 'json', '~> 1.8.1'
gem 'compass', '~> 1.0.0.alpha.19'
bundle install shows the error
Gem::Installer::ExtensionBuildError: ERROR: Failed to build gem native extension.
/usr/bin/ruby1.9.1 extconf.rb
/usr/lib/ruby/1.9.1/rubygems/custom_require.rb:36:in `require': cannot load such file -- mkmf (LoadError)
from /usr/lib/ruby/1.9.1/rubygems/custom_require.rb:36:in `require'
from extconf.rb:1:in `<main>'
Gem files will remain installed in /home/bernie/.bundler/tmp/6210/gems/json-1.8.1 for inspection.
Results logged to /home/bernie/.bundler/tmp/6210/gems/json-1.8.1/ext/json/ext/generator/gem_make.out
An error occurred while installing json (1.8.1), and Bundler cannot continue.
Make sure that `gem install json -v '1.8.1'` succeeds before bundling.
gem list shows:
bundler (1.5.1)
celluloid (0.15.2)
chunky_png (1.3.0)
compass (0.12.4)
compass-core (1.0.0.alpha.19)
compass-import-once (1.0.4)
fssm (0.2.10)
multi_json (1.9.2)
permutation (0.1.8)
rake (10.2.0)
rb-fsevent (0.9.4)
sass (3.3.4, 3.2.18)
susy (2.1.1)
timers (1.1.0)
Any Ideas?
A little bit Googling told me this, have you tried it?
sudo apt-get install ruby1.9.1-dev
Related
I'm trying to write a rubygem that does some stuff with homebrew. I'm calling on brew to do some stuff using system(). When I include certain gems in using bundler, I get some errors doing things inside system().
As an example, a basic Gemfile with rake:
~/tmp/foo cat Gemfile
source 'https://rubygems.org'
gem 'rake'
Inside irb after running a bundle install:
irb(main):001:0> system("brew", "info", "ack")
Could not find rake-12.0.0 in any of the sources
Run `bundle install` to install missing gems.
=> false
I can do a bundle install inside the call and receive the same results:
rb(main):007:0> system("bundle", "install")
Using rake 12.0.0
Using bundler 1.14.6
Bundle complete! 1 Gemfile dependency, 2 gems now installed.
Bundled gems are installed into /Users/laura/.bundle.
=> true
irb(main):008:0> system("brew", "version")
Could not find rake-12.0.0 in any of the sources
Run `bundle install` to install missing gems.
=> false
Without the rake gem included I do not receive any errors:
~/tmp/foo cat Gemfile
source 'https://rubygems.org'
gem 'git'
~/tmp/foo bundle install
Fetching gem metadata from https://rubygems.org/.
Fetching version metadata from https://rubygems.org/
Resolving dependencies...
Using git 1.3.0
Using bundler 1.14.6
Bundle complete! 1 Gemfile dependency, 2 gems now installed.
Bundled gems are installed into /Users/surminus/.bundle.
~/tmp/foo
~/tmp/foo irb
irb(main):002:0> system("brew", "info", "ack")
ack: stable 2.16, HEAD
Search tool like grep, but optimized for programmers
https://beyondgrep.com/
/usr/local/Cellar/ack/2.14 (4 files, 184.7KB)
Built from source on 2016-12-16 at 16:24:07
/usr/local/Cellar/ack/2.16 (4 files, 190.7KB) *
Built from source on 2017-03-17 at 20:25:45
From: https://github.com/Homebrew/homebrew-core/blob/master/Formula/ack.rb
=> true
I know it's probably related to some conflict between homebrew, rake and bundler, but I can't for the life of me figure out what's going on. I only need to rake tasks for some development specific tasks so I can remove it, but I'm interested to find out why this occurs, or if indeed calling brew this way is $bad.
EDIT: I was asked for output of gem list --local in the bundle directory. Seems to be system gems. With bundle exec:
~/tmp/foo bundle exec gem list --local
*** LOCAL GEMS ***
bundler (1.14.6)
rake (12.0.0)
Without bundle exec:
~/tmp/foo gem list --local
*** LOCAL GEMS ***
activemodel (5.0.1)
activesupport (5.0.1)
addressable (2.5.0)
bigdecimal (1.2.8)
bundler (1.14.6, 1.14.5, 1.13.6)
CFPropertyList (2.2.8)
coderay (1.1.1)
commander (4.4.2)
concurrent-ruby (1.0.3)
did_you_mean (1.0.0)
diff-lcs (1.3, 1.2.5)
domain_name (0.5.20161129)
facter (2.4.6 ruby universal-darwin)
fileutils (0.7)
git (1.3.0)
hiera (1.3.4)
highline (1.7.8)
http-cookie (1.0.3)
i18n (0.7.0)
io-console (0.4.5)
json (2.0.2, 1.8.3)
json_pure (2.0.1, 1.8.3)
metaclass (0.0.4)
method_source (0.8.2)
mime-types (3.1)
mime-types-data (3.2016.0521)
minitest (5.10.1, 5.8.3)
mocha (1.2.1, 1.1.0)
myosx (0.2.2, 0.2.0, 0.1.0)
net-telnet (0.1.1)
netrc (0.11.0)
oauth (0.5.1)
power_assert (0.2.6)
pry (0.10.4)
psych (2.0.17)
public_suffix (2.0.4)
puppet (3.8.7)
puppet-lint (1.1.0)
puppet-syntax (2.3.0, 2.1.0)
puppetlabs_spec_helper (1.1.1)
rake (12.0.0, 11.1.2, 10.5.0, 10.4.2)
rdoc (4.2.1)
rest-client (2.0.0)
rmagick (2.16.0)
rspec (3.5.0, 3.4.0)
rspec-core (3.5.4, 3.4.4)
rspec-expectations (3.5.0, 3.4.0)
rspec-mocks (3.5.0, 3.4.1)
rspec-puppet (2.4.0)
rspec-support (3.5.0, 3.4.1)
ruby-trello (1.6.0)
slop (3.6.0)
test-unit (3.1.5)
thread_safe (0.3.5)
tzinfo (1.2.2)
unf (0.1.4)
unf_ext (0.0.7.2)
Ruby Compass not working, code is bellow, and I've tried 10-20 methods on the web, any suggestions ?
In the screenshot you'll find an easier way to read the terminal dump of my gems and the error, in case you want to take something from there, you'll find the text under the screenshot
Thanks,
Cheers,
Robert
RubyGems is a sophisticated package manager for Ruby. This is a
basic help message containing pointers to more information.
Usage:
gem -h/--help
gem -v/--version
gem command [arguments...] [options...]
Examples:
gem install rake
gem list --local
gem build package.gemspec
gem help install
Further help:
gem help commands list all 'gem' commands
gem help examples show some examples of usage
gem help gem_dependencies gem dependencies file guide
gem help platforms gem platforms guide
gem help <COMMAND> show help on COMMAND
(e.g. 'gem help install')
gem server present a web page at
http://localhost:8808/
with info about installed gems
Further information:
http://guides.rubygems.org
sh-3.2# gem list
*** LOCAL GEMS ***
bigdecimal (1.2.5, 1.2.0)
CFPropertyList (2.2.8, 2.2.0)
chunky_png (1.3.1)
compass (1.0.1)
compass-core (1.1.0.alpha.0, 1.0.1)
compass-import-once (1.0.5)
ffi (1.9.3)
io-console (0.4.2)
json (1.8.1, 1.7.7)
libxml-ruby (2.7.0, 2.6.0)
mini_portile (0.6.0)
minitest (5.4.1, 4.3.2)
multi_json (1.10.1)
nokogiri (1.6.3.1, 1.5.6)
power_assert (0.1.3)
psych (2.0.5, 2.0.0)
rake (10.3.2, 0.9.6)
rb-fsevent (0.9.4)
rb-inotify (0.9.5)
rdoc (4.1.1, 4.0.0)
rubygems-update (2.4.1)
sass (3.4.2)
sqlite3 (1.3.9, 1.3.7)
test-unit (3.0.1, 2.0.0.0)
sh-3.2# compass compile -e production --force
LoadError on line ["54"] of /Library/Ruby/Site/2.0.0/rubygems/core_ext/kernel_require.rb: cannot load such file -- rgbapng
Run with --trace to see the full backtrace
Fixed by installing the following compass extensions :
gem install compass-normalize
gem install compass-rgbapng
gem install toolkit
That did not fix it for me. However, I was able to fix it by reinstalling the compass gem using
gem uninstall compass
gem install compass
I think you can probably fix it even easier by just updating the compass gem to the latest version using gem update compass.
Note: If you use rails, you might also have to update your compass-rails gem. Otherwise, the compass watch command will start to hang. See this issue on github
I have got following error on running 'bundle install'
Bundler could not find compatible versions for gem "railties":
In Gemfile:
rails-api (>= 0) ruby depends on
railties (>= 3.2.11) ruby
rails (= 3.2.9) ruby depends on
railties (3.2.9)
while update bundle gives also the same error
while gem install railties give following
ERROR: Error installing railties:
ERROR: Failed to build gem native extension.
/usr/bin/ruby1.9.1 extconf.rb
/usr/lib/ruby/1.9.1/rubygems/custom_require.rb:36:in `require': cannot load such file -- mkmf (LoadError)
from /usr/lib/ruby/1.9.1/rubygems/custom_require.rb:36:in `require'
from extconf.rb:13:in `<main>'
my gem file look like
source 'https://rubygems.org'
gem 'rails', '3.2.9'
gem 'sqlite3'
gem 'webapidoc', :github => 'otty/webapidoc'
#gem 'webapidoc', path: '/Users/lion/Work/rails/webapidoc'
gem 'rails-api', :github => 'rails-api/rails-api'
gem 'foreman'
gem 'tire'
gem 'yajl-ruby'
gem 'sync_attr'
gem 'thin'
gem 'capistrano'
gem 'capistrano-unicorn'
gem 'capistrano-ext'
gem 'rvm-capistrano'
gem 'capistrano-detect-migrations'
I am trying to work on a new project on Ubuntu. After cloning the GitHub repo and installing ruby sudo apt-get install ruby, y perform
bundle install
and I get this feedback:
$ bundle install
Fetching gem metadata from https://rubygems.org/...........
Fetching gem metadata from https://rubygems.org/..
Resolving dependencies...
Using rake (10.0.4)
Using coderay (1.0.9)
Using coffee-script-source (1.6.2)
Using multi_json (1.7.2)
Using execjs (1.4.0)
Using coffee-script (2.2.0)
Installing ffi (1.8.1)
Gem::Installer::ExtensionBuildError: ERROR: Failed to build gem native extension.
/usr/bin/ruby1.9.1 extconf.rb
/usr/lib/ruby/1.9.1/rubygems/custom_require.rb:36:in `require': cannot load such file -- mkmf (LoadError)
from /usr/lib/ruby/1.9.1/rubygems/custom_require.rb:36:in `require'
from extconf.rb:4:in `<main>'
Gem files will remain installed in /home/dbugger/.bundler/tmp/24874/gems/ffi-1.8.1 for inspection.
Results logged to /home/dbugger/.bundler/tmp/24874/gems/ffi-1.8.1/ext/ffi_c/gem_make.out
An error occurred while installing ffi (1.8.1), and Bundler cannot continue.
Make sure that `gem install ffi -v '1.8.1'` succeeds before bundling.
What am I missing?
Try sudo apt-get install ruby1.9-dev.
Then bundle install again.
As an aside you probably want to not mess with the system ruby and install ruby locally instead with rbenv or rvm.
I'm having a problem with my gems dependencies: the content of the Gemfile is
source :gemcutter
gem "sinatra"
gem "koala"
gem "json", "1.5.5"
gem "httparty"
gem "thin"
gem "rack", "1.3.10"
And a bundle install hit me with this error
$ sudo bundle install
The source :gemcutter is deprecated because HTTP requests are insecure.
Please change your source to 'https://rubygems.org' if possible, or 'http://rubygems.org' if not.
Fetching gem metadata from http://rubygems.org/.......
Fetching gem metadata from http://rubygems.org/..
Using addressable (2.2.7)
Using crack (0.1.8)
Using daemons (1.1.3)
Installing eventmachine (0.12.10)
Gem::Installer::ExtensionBuildError: ERROR: Failed to build gem native extension.
/usr/bin/ruby1.9.1 extconf.rb
/usr/lib/ruby/1.9.1/rubygems/custom_require.rb:36:in `require': cannot load such file -- mkmf (LoadError)
from /usr/lib/ruby/1.9.1/rubygems/custom_require.rb:36:in `require'
from extconf.rb:1:in `<main>'
Gem files will remain installed in /var/lib/gems/1.9.1/gems/eventmachine-0.12.10 for inspection.
Results logged to /var/lib/gems/1.9.1/gems/eventmachine-0.12.10/ext/gem_make.out
An error occurred while installing eventmachine (0.12.10), and Bundler cannot continue.
Make sure that `gem install eventmachine -v '0.12.10'` succeeds before bundling.
However, I do have eventmachine installed!:
$ gem list
*** LOCAL GEMS ***
eventmachine (1.0.3, 1.0.0.rc.4, 0.12.10)
Help me, you're my only hope! Thank you.
ruby 1.9.1 had some issues with C extensions. Try to check if you have mkmf:
locate mkmf
or install dev version of ruby 1.9.1:
sudo apt-get install ruby1.9.1-dev
I recommend to use RVM for installing rubies: https://rvm.io/
You can also try to change source in your Gemfile
source 'https://rubygems.org'
instead of :gemcutter