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.
Related
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 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
I am trying to get my ruby environment properly setup, but keep receiving errors when attempting to bundle install my test app.
I first get an error when trying to bundle install:
$ rails new app
// [...]
run bundle install
Fetching gem metadata from https://rubygems.org/..
Resolving dependencies...
Using rake (10.1.0)
Using i18n (0.6.5)
Using multi_json (1.7.9)
Using activesupport (3.2.9)
Using builder (3.0.4)
Using activemodel (3.2.9)
Using erubis (2.7.0)
Using journey (1.0.4)
Using rack (1.4.5)
Using rack-cache (1.2)
Using rack-test (0.6.2)
Using hike (1.2.3)
Using tilt (1.4.1)
Using sprockets (2.2.2)
Using actionpack (3.2.9)
Using mime-types (1.23)
Using polyglot (0.3.3)
Using treetop (1.4.14)
Using mail (2.4.4)
Using actionmailer (3.2.9)
Using arel (3.0.2)
Using tzinfo (0.3.37)
Using activerecord (3.2.9)
Using activeresource (3.2.9)
Using bundler (1.3.5)
Using coffee-script-source (1.6.3)
Using execjs (1.4.0)
Using coffee-script (2.2.0)
Using rack-ssl (1.3.3)
Installing json (1.8.0)
Gem::Installer::ExtensionBuildError: ERROR: Failed to build gem native extension.
/Users/ryan/.rvm/rubies/ruby-1.9.3-p327/bin/ruby extconf.rb
creating Makefile
make
compiling generator.c
gcc-4.6: error: x86_64: No such file or directory
gcc-4.6: error: unrecognized option '-arch'
make: *** [generator.o] Error 1
Gem files will remain installed in /Users/ryan/.rvm/gems/ruby-1.9.3-p327/gems/json-1.8.0 for inspection.
Results logged to /Users/ryan/.rvm/gems/ruby-1.9.3-p327/gems/json-1.8.0/ext/json/ext/generator/gem_make.out
An error occurred while installing json (1.8.0), and Bundler cannot continue.
Make sure that `gem install json -v '1.8.0'` succeeds before bundling.
Following the last line of the error message I attempt to gem install json -v '1.8.0' but get the following:
Building native extensions. This could take a while...
ERROR: Error installing json:
ERROR: Failed to build gem native extension.
/Users/ryan/.rvm/rubies/ruby-1.9.3-p327/bin/ruby extconf.rb
creating Makefile
make
compiling generator.c
gcc-4.6: error: x86_64: No such file or directory
gcc-4.6: error: unrecognized option '-arch'
make: *** [generator.o] Error 1
Gem files will remain installed in /Users/ryan/.rvm/gems/ruby-1.9.3-p327/gems/json-1.8.0 for inspection.
Results logged to /Users/ryan/.rvm/gems/ruby-1.9.3-p327/gems/json-1.8.0/ext/json/ext/generator/gem_make.out
Any help would be greatly appreciated... I currently using the following versions of rvm, ruby + rails:
$ ruby -v
ruby 1.9.3p327 (2012-11-10) [x86_64-darwin12.2.0]
$ rails -v
Rails 3.2.9
$ rvm -v
rvm 1.22.1 (stable) by Wayne E. Seguin <wayneeseguin#gmail.com>, Michal Papis <mpapis#gmail.com> [https://rvm.io/]
Please let me know if you need any other information.
sounds like this can be caused by binary ruby, try:
rvm get head
rvm reinstall 1.9.3-p327 --disable-binary
delete gemfile.lock and run bundle
If you have rvm installed, this should work:
rvm reinstall 2.0.0-p247 --disable-binary
If you just updated OS X, you might want to try some other things first. See thoughtbot's guide.
I had this problem, I decided to changing the default version of Ruby for 1.9.3p327.
Leaving the project folder and making the command:
rvm use 1.9.3-P327 --default
I do not know why this, for rvm modifies the version within the project, but after doing it gave no error when doing the 'bundle install'
I think you should set correct version your rvm. for example if your developed your application in ruby 1.9.3, you should set
"rvm use 1.9.3". Then you can enter "bundle install" command. Maybe this will help you.
Thanks
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
I'm currently trying to install Webistrano on a freshly installed debian squeeze 64bits, but I'm facing some issues that I can't manage to solve.
Note: The machine is created under Xen environment, I don't think this affect the procedure however it seemed important to mention it.
Procedure:
Informations:
Ruby version: ruby 1.8.7 (2010-08-16 patchlevel 302) [x86_64-linux]
Rails version: `Rails 2.3.11
Path modifier with: /usr/lib/ruby/1.8:/var/lib/gems/1.8/bin
Rails env: development
Databases have been created
Databases setups for webistrano are, I believe correct (user/pass/path_to_sock_file)
So, here is what I did:
I first installed the 'basics' packages for such installation:
# apt-get install build-essential ruby rubygems libmysql-ruby libmysqlclient-dev libdbd-mysql-ruby mysql-server unzip rake
Then I have been downloading and extracting the project into /usr/src. After copying and configuring the files for email/databses setups (as suggested by https://github.com/peritor/webistrano), I continued by installing all the gems needed for the project:
bundle install
at this point, the command is stuck and isn't doing anything for an hour.
I know it can happen if the Gemfile is complicate, but it doesn't seem to be the case for me. (see the Gemfile following)
# cat Gemfile
source "http://rubygems.org"
gem 'bundler', "~>1.0.10"
gem "rails", "2.3.11"
gem "mysql"
gem "erubis"
gem "rake"
gem "syntax", "1.0.0"
gem "capistrano", "2.6.0"
gem "open4", "0.9.3"
gem "exception_notification", "2.3.3.0"
group :test do
gem "mocha", "0.9.8"
end
So deciding to go ahead I installed the gems by hands, which once finished gives:
# gem list *gems of Gemfile*
bundler (1.0.10)
rails (2.3.11)
mysql (2.8.1)
erubis (2.7.0)
rake (0.9.2.2)
syntax (1.0.0)
capistrano (2.6.0)
open4 (0.9.3)
exception_notification (2.3.3.0)
mocha (0.9.8)
So I believe everything should be working without having to run: bundle install
This is why I finally tried to create the database's structure with rake:
# rake db:migrate --trace
(in /usr/src/peritor-webistrano-a98ba6b)
rake aborted!
Bundler couldn't find some gems.Did you run `bundle install`?
/usr/src/peritor-webistrano-a98ba6b/config/../config/preinitializer.rb:18
/usr/src/peritor-webistrano-a98ba6b/config/boot.rb:28:in `load'
/usr/src/peritor-webistrano-a98ba6b/config/boot.rb:28:in `preinitialize'
/usr/src/peritor-webistrano-a98ba6b/config/boot.rb:10:in `boot!'
/usr/src/peritor-webistrano-a98ba6b/config/boot.rb:123
/usr/src/peritor-webistrano-a98ba6b/Rakefile:4:in `require'
/usr/src/peritor-webistrano-a98ba6b/Rakefile:4
/usr/lib/ruby/1.8/rake.rb:2383:in `load'
/usr/lib/ruby/1.8/rake.rb:2383:in `raw_load_rakefile'
/usr/lib/ruby/1.8/rake.rb:2017:in `load_rakefile'
/usr/lib/ruby/1.8/rake.rb:2068:in `standard_exception_handling'
/usr/lib/ruby/1.8/rake.rb:2016:in `load_rakefile'
/usr/lib/ruby/1.8/rake.rb:2000:in `run'
/usr/lib/ruby/1.8/rake.rb:2068:in `standard_exception_handling'
/usr/lib/ruby/1.8/rake.rb:1998:in `run'
/usr/bin/rake:28
According to rake error message, apparently some gems aren't properly installed, which seems weird to be, but I guess he can't find it.
So I double check with bundle tool:
# bundle check
Your Gemfile's dependencies could not be satisfied
Install missing gems with `bundle install`
# bundle show
Could not find gem 'mocha (= 0.9.8, runtime)' in any of the gem sources listed in your Gemfile.
And I'm stuck here, I just don't know how to continue.
I google around about mocha or gemfile issue, but haven't found much relevant.
I hope everything is clear and easy to understand as this is my first post.
Thanks for any reply/hints, also if I manage to evolve I'll try keeping you up to date!
Check these instructions:
http://www.gogolek.co.uk/blog/2012/10/web-application-deployment-webistrano-capistrano/
Additionally I had problems with mysql gem installation on my clean debian 6 64-bit, so I had to run
$ apt-get install libmysqlclient-dev ruby-dev
I ended up with following gems installed
Using rake (0.8.7)
Using activesupport (2.3.11)
Using rack (1.1.6)
Using actionpack (2.3.11)
Using actionmailer (2.3.11)
Using activerecord (2.3.11)
Using activeresource (2.3.11)
Using bundler (1.0.10)
Using highline (1.6.20)
Using net-ssh (2.7.0)
Using net-scp (1.1.2)
Using net-sftp (2.1.2)
Using net-ssh-gateway (1.2.0)
Using capistrano (2.6.0)
Using erubis (2.7.0)
Using exception_notification (2.3.3.0)
Using mocha (0.9.8)
Installing mysql (2.9.1) with native extensions
Installing open4 (0.9.3)
Installing rails (2.3.11)
Installing syntax (1.0.0)
Your bundle is updated! Use `bundle show [gemname]` to see where a bundled gem is installed.