I am building a facebook app using heroku. I used:
gem install taps
It gave error:
extconf.rb:36:in `require': no such file to load -- mkmf (LoadError) from extconf.rb:36
I googled it and found the stackoverflow link
I then used:
sudo aptitude install ruby1.9.1-dev build-essential
then I again tried:
gem install taps
It gave error:
checking for sqlite3.h... no
sqlite3.h is missing
I installed sqlite3 using sudo apt-get install sqlite3 but when I tried again
(gem install taps) it still gives the error:
checking for sqlite3.h... no
sqlite3.h is missing
Sounds like you need the dev package for sqlite3:
sudo apt-get install libsqlite3-dev
Related
I installed Ruby v2.1.4 from source. I installed all necessary libaries using:
yum install gcc g++ make automake autoconf curl-devel openssl-devel zlib-devel httpd-devel apr-devel apr-util-devel sqlite-devel
All succeeded.
Now when I want to install a gem with:
gem install bundler-1.7.4.gem
I get:
ERROR: Loading command: install (LoadError)
cannot load such file -- zlib
ERROR: While executing gem ... (NoMethodError)
undefined method `invoke_with_build_args' for nil:NilClass
I am sure that zlib is installed:
locate zlib
results in a long list of
/lib/modules/2.6.32-431.el6.x86_64/kernel/crypto/zlib.ko
/lib/modules/2.6.32-431.el6.x86_64/kernel/lib/zlib_deflate
/lib/modules/2.6.32-431.el6.x86_64/kernel/lib/zlib_deflate/zlib_deflate.ko
/lib64/rsyslog/lmzlibw.so
/usr/include/zlib.h
/usr/lib64/pkgconfig/zlib.pc
/usr/lib64/python2.6/encodings/zlib_codec.py
/usr/lib64/python2.6/encodings/zlib_codec.pyc
/usr/lib64/python2.6/encodings/zlib_codec.pyo
/usr/lib64/python2.6/lib-dynload/zlibmodule.so
/usr/local/share/doc/ruby/capi/html/db/d74/zlib_8c.html
/usr/local/share/doc/ruby/capi/html/db/d74/zlib_8c_source.html
/usr/local/share/ri/2.1.0/system/Zlib/zlib_version-c.ri
/usr/share/doc/zlib-1.2.3
/usr/share/doc/zlib-devel-1.2.3
/usr/share/doc/zlib-1.2.3/ChangeLog
/usr/share/doc/zlib-1.2.3/FAQ
/usr/share/doc/zlib-1.2.3/README
/usr/share/doc/zlib-devel-1.2.3/README
/usr/share/doc/zlib-devel-1.2.3/algorithm.txt
/usr/share/doc/zlib-devel-1.2.3/example.c
/usr/share/doc/zlib-devel-1.2.3/minigzip.c
/usr/share/man/man3/zlib.3.gz
/usr/src/kernels/2.6.32-431.el6.x86_64/include/config/zlib
/usr/src/kernels/2.6.32-431.el6.x86_64/include/config/crypto/zlib.h
/usr/src/kernels/2.6.32-431.el6.x86_64/include/config/jffs2/zlib.h
/usr/src/kernels/2.6.32-431.el6.x86_64/include/config/ubifs/fs/zlib.h
/usr/src/kernels/2.6.32-431.el6.x86_64/include/config/zlib/deflate.h
/usr/src/kernels/2.6.32-431.el6.x86_64/include/config/zlib/inflate.h
/usr/src/kernels/2.6.32-431.el6.x86_64/include/linux/zlib.h
/usr/src/kernels/2.6.32-431.el6.x86_64/lib/zlib_deflate
/usr/src/kernels/2.6.32-431.el6.x86_64/lib/zlib_inflate
/usr/src/kernels/2.6.32-431.el6.x86_64/lib/zlib_deflate/Makefile
/usr/src/kernels/2.6.32-431.el6.x86_64/lib/zlib_inflate/Makefile
Did I miss something?
I have found the solution at this blog. I am unable to use rvm because server have no internet connection even through proxy.
While installing ruby from sources doing the following solved the issue:
Remove the installed Ruby with make clean
Install libssl-dev with your OS's package manager of choice. E.g. apt-get install libssl-dev
Install zlib1g-dev with your OS's package manager of choice. E.g. apt-get install zlib1g-dev
Config make file to include openssl by go to ext/openssl and run ruby extconf.rb
Config make file to include zlib by go to ext/zlib and run ruby extconf.rb
Go back to ruby source code directory run make && make install
You should be able to successfully run gem install bundler
I want to install in my Fedora 12 based planet lab nodes one OMF RC:
It requres ruby 1.9.3. So, I installed git, then ruby-devel then rvm. With rvm i installed:
rvm install 1.9.3
After all this when i want to install:
gem install omf_rc --pre --no-ri --no-rdoc
It gives me the following error:
Building native extensions. This could take a while...
ERROR: Error installing omf_rc:
ERROR: Failed to build gem native extension.
/usr/local/rvm/rubies/ruby-1.9.3-p194/bin/ruby extconf.rb
checking for libxml/parser.h... * extconf.rb failed *
Could not create Makefile due to some reason, probably lack of
necessary libraries and/or headers
Please let me know how to solve this. Thanks
seems you need to install libxml, try:
sudo yum install -y gcc ruby-devel libxml2 libxml2-devel libxslt libxslt-devel
Also it needs the following installation:
sudo yum install -y git make gcc-c++
and
sudo yum groupinstall development-tools development-libs
I'm installing the Ruby Nokogiri gem and finding the error below.
How to diagnose this and solve it?
# gem install nokogiri
Building native extensions. This could take a while...
ERROR: Error installing nokogiri:
ERROR: Failed to build gem native extension.
...
/opt/ruby/1.9.3-p194/bin/ruby extconf.rb
checking for libxml/parser.h... *** extconf.rb failed ***
Could not create Makefile due to some reason, probably lack of
necessary libraries and/or headers. Check the mkmf.log file for more
details. You may need configuration options.
...
/opt/ruby/1.9.3-p194/lib/ruby/1.9.1/mkmf.rb:381:in `try_do':
The compiler failed to generate an executable file. (RuntimeError)
You have to install development tools first.
from /opt/ruby/1.9.3-p194/lib/ruby/1.9.1/mkmf.rb:506:in `try_cpp'
...
To diagnose and solve, here's what worked for me.
To find out what failed, go to your ruby gems directory.
For example:
$ cd <MY RUBY DIRECTORY>/lib/ruby/gems/2.0.0/gems
If you don't know your gem directory, try this:
$ echo $GEM_HOME
/opt/gems/2.0.0
$ cd /opt/gems/2.0.0/gems
What version of nokogiri am I installing?
$ ls -ladg nokogiri-*
nokogiri-1.5.5
Go to the installer directory:
$ cd nokogiri-1.5.5/ext/nokogiri
Try installing manually:
$ ruby extconf.rb
Result:
checking for libxml/parser.h... *** extconf.rb failed ***
...
I'm using Ubuntu so I search for any similar packages:
$ aptitude search libxml
Results:
p libxml2 - GNOME XML library
p libxml2-dev - Development files for the GNOME XML library
...
I believe that libxml2 will work fine.
$ apt-get install libxml2
Ruby native gems often need the *-dev packages for headers so install them:
$ apt-get install libxml2-dev
Now do I have the parser file?
$ find / | grep libxml/parser.h
Yes, the result shows the parser:
/usr/include/libxml2/libxml/parser.h
Now try installing again, this time providing the libxml2 path:
$ gem install nokogiri -- --with-xml2-dir=/usr/include/libxml2
It still fails, so read the mkmf error log:
$ more mkmf.log
The error log shows what failed and has these lines that look promising:
package configuration for libxslt is not found
Is there a package for it?
$ aptitude search libxslt
Results:
v libxslt-dev
i libxslt-ruby
...
Install the dev package:
$ apt-get install libxslt-dev
Now try installing again, and also put xslt on the path:
$ gem install nokogiri -- \
--with-xml2-dir=/usr/include/libxml2 \
--with-xslt-dir=/usr/include/libxslt
Success!
Installing Nokogiri Website
'Installing Nokogiri' is a website dedicated to installing Nokogiri on the major platforms - Here is an excerpt about Installing Nokogiri on Ubuntu:
Because Nokogiri needs to be compiled and dynamically linked against
both libxml2 and libxslt, it has gained a reputation for being
complicated to install.
As of Nokogiri 1.6, libxml2 and libxslt source code is bundled with
Nokogiri, and compiled at gem-install-time. The instructions in this
document should work for all versions 1.6.4 and later.
Ubuntu / Debian
Installation should Just Work™ on Ubuntu and Debian using Nokogiri’s
vendored libxml2 and libxslt:
gem install nokogiri
[...]
Using Your System Libraries
If, instead of Nokogiri’s vendored libraries, you’d like to use your
system’s libxml2, libxslt and related libraries, please first
understand that you may be asking Nokogiri to work with an unsupported
version of libxml2.
sudo apt-get install pkg-config
gem install nokogiri -- --use-system-libraries
FYI - I am using Nokogiri 1.6.6.2 and it didn't 'just work'. I got it going with the --use-system-libraries.
Mac OS X
The website's advice also covers OS X - this worked for me:
gem update --system
xcode-select --install
gem install nokogiri
Conclusion
If you have a Nokogiri problem on any platform you should check out the website.
On CentOS here is what I needed to do:
gem update --system
yum install libxml2-devel libxslt-devel ruby-devel
gem install nokogiri -- --use-system-libraries
Could not create Makefile due to some reason, probably lack of necessary libraries and/or headers.
You are probably missing zlib headers which are required for -lz flag in order to compile the sources correctly. Install on Linux by:
sudo apt-get install libz-dev
For missing libiconv, try installing libiconv-hook-dev package which has header files of libiconv-hook, e.g.
sudo apt-get install libiconv-hook1 libiconv-hook-dev
On OS X, try installing development tools via: xcode-select --install.
If there is still problem, check mkmf.log file for more specific details about your error.
On Ubuntu, try the following dependency fix combo:
sudo apt-get install gcc ruby-dev libxslt-dev libxml2-dev zlib1g-dev
The 'could not create Makefile' error you're seeing could also be because you haven't agreed to the Xcode license (you have to agree to it after each time you update Xcode). Running sudo xcodebuild -license accept should eliminate this error for you and allow you to then run gem install nokogiri successfully.
When I try to do a bundle install I get the following json error. The bundle install does not complete. What gives?
Errno::EACCES: Permission denied - /usr/local/Cellar/ruby/1.9.3-p194/lib/ruby/gems/1.9.1/gems/json-1.7.5/.gitignore
An error occurred while installing json (1.7.5), and Bundler cannot continue.
Make sure that `gem install json -v '1.7.5'` succeeds before bundling.
>>$ gem install json -v '1.7.5'
ERROR: While executing gem ... (Errno::EACCES)
Permission denied - /usr/local/Cellar/ruby/1.9.3-p194/lib/ruby/gems/1.9.1/gems/json-1.7.5/.gitignore
EDIT: The sudo install command gives the following error:
>>$ sudo gem install json -v '1.7.5'
Building native extensions. This could take a while...
ERROR: Error installing json:
ERROR: Failed to build gem native extension.
/usr/local/Cellar/ruby/1.9.3-p194/bin/ruby extconf.rb
creating Makefile
make
sh: make: command not found
Gem files will remain installed in /usr/local/Cellar/ruby/1.9.3-p194/lib/ruby/gems/1.9.1/gems/json-1.7.5 for inspection.
Results logged to /usr/local/Cellar/ruby/1.9.3-p194/lib/ruby/gems/1.9.1/gems/json-1.7.5/ext/json/ext/generator/gem_make.out
you need to install ruby1.8-dev and not just ruby1.8, you are missing the development headers.
if on OSX:
sudo install ruby1.8-dev
if on unix
sudo aptitude install ruby1.8-dev
or
sudo apt-get install ruby1.8-dev
go into your directory with rubygems source and run:
sudo ruby setup.rb
after that run:
if on OSX:
sudo gem install json -v '1.7.5'
some unix system may need gem version command to work properly so you should run:
sudo gem1.8 install json -v '1.7.5'
Try using this script
sudo chown -R $USER /usr/local
Found the answer here: "sh: make: command not found" when running "$ bundle" after adding redcarpet gem to Rails app Needed to upgrade command line tools after installing Mountain Lion
I want to install Octopress in my computer.
I try to do it like
Octopress document.
When I run
bundle install
I got error message
An error occured while installing RedCloth (4.2.9), and Bundler cannot continue.
Make sure that `gem install RedCloth -v '4.2.9'` succeeds before bundling.
So, I run
sudo gem install RedCloth -v '4.2.9'
then, I got a error message again:
ERROR: Error installing RedCloth:
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>'
I hadn't learn any knowledge about ruby.
My ubuntu 12.04 solution is install the ruby1.9.1-full version, that can resolve this issue.
sudo apt-get install ruby1.9.1-full
you can execute command:
sudo update-alternatives --config ruby
to select the altiernative ruby which you have installed.
and then, execute below commands to finish the octopress deploy:
git clone https://github.com/erizhang/octopress.git octopress
cd octopress/
sudo gem install bundler
sudo gem install RedCloth -v '4.2.9'
bundle install
rake install
below commands you can find from octopress deploy guideline page:
rake setup_github_pages
sudo rake setup_github_pages
sudo rake generate
sudo rake deploy
Hope it's helpful for you, thanks
I was installing Octopress too and got the same problem as yours. After checking the mkmf.log file I figured out that gcc-4.2 had not been found. I Even installed xcode with the command line tools. It worked when I made a symlink like this:
$ sudo ln -s /usr/bin/gcc /usr/bin/gcc-4.2
$ bundle install
I fixed this issue by running
sudo apt-get install ruby-dev
as described in this blog post.
You've probably upgraded to Mountain Lion and have not rebuilt your ruby-1.9.2 install yet with the new development packages.
rvm --force install 1.9.2
gem install bundle --no-ri --no-rdoc
bundle install
If you don't have the Mountain Lion dev packages installed correctly, use the ThoughtBot instructions.
For Ubuntu 14.04 simply do this:
sudo apt-get install ruby1.9.3
Should work for 13.10 and 13.04 too. (Not tested)
it apears you are not using rvm for managing your ruby installation. I think best would be to try rvm, here's a very good guide, you can stop without installing rails: ruby with rvm
Then simply
$gem install RedCloth
Unmanaged ruby gems are a pain, I try to avoid them.
None of the answers worked on my Ubuntu 14.04.1 LTS. Upgrade to ruby 2.0 fixed the problem for me:
sudo apt-get install ruby2.0 ruby2.0-dev
sudo ln -s /usr/bin/ruby2.0 /usr/bin/ruby
sudo ln -s /usr/bin/gem2.0 /usr/bin/gem
sudo gem install bundler
Make sure you also have the build-essential package installed. You can check using
dpkg -l | grep build-essential
or simply install it without checking
sudo apt-get install build-essential
For me on Ubuntu 14.04.1 LTS, after making sure build-essential is installed, the bundle install command works/builds fine also with Ruby 1.9.3.