I'm having some trouble installing jekyll. Can't quite figure out how to patch the missing link. I think it's an update to Ruby, but RVM is having trouble installing alternate versions of ruby as well.
Heres the full post:
$ sudo gem install jekyll
ERROR: Error installing jekyll:
ERROR: Failed to build gem native extension.
/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/bin/ruby extconf.rb
mkmf.rb can't find header files for ruby at /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/ruby.h
Gem files will remain installed in /Library/Ruby/Gems/1.8/gems/fast-stemmer-1.0.1 for inspection.
Results logged to /Library/Ruby/Gems/1.8/gems/fast-stemmer-1.0.1/ext/gem_make.out
Does this mean I need to update the version of ruby I'm using via rvm?
Ubuntu
sudo apt-get install ruby-dev
gem install jekyll
Your problem is that either you system doesn't know where make is located at or you don't have it installed. The easiest way to fix this (and probably other issues you'll run into trying to get a ruby system up and running) is to install xcode.
You can get it at http://itunes.apple.com/us/app/xcode/id497799835?ls=1&mt=12 for lion. Or it came on a CD with your computer for earlier versions.
If you're using Lion, please see comments below for a link to how to install developer tools on Lion.
I had the same error on Ubuntu and this helped me sort it out.
You must have ruby-dev installed
apt-get install ruby-dev
If you installed XCode and command line tools are still missing go to Terminal and
xcode-select --install
it will prompt you to install these tools. After that just follow SrBlanco´s answer. That solved the problem for me.
Good luck.
Need to install "make".
I am using Ubuntu 12.10.
sudo apt-get install make
Should work on any Debian based distro.
Note: this problem also occurs on newer MacBook Pro models that come with Mavericks pre-installed. I updated another post with my own solution that didn't involve Xcode at all. My system had the Xcode developer tools installed when I got the machine.
ERROR: Error installing jekyll: ERROR: Failed to build gem native extension
Install Xcode as mentioned if you don't have it installed already (https://developer.apple.com/xcode/). Plus you need the command line tools.
Open Xcode. Go to Preferences > Downloads > Install Command Line Tools
Installing command line tools for Xcode solved the problem for me on my Mac
xcode-select --install.
sudo apt-get install ruby-dev
sudo gem install jekyll
hope this will help, it works with me.
I had this same exact error when trying to install Jekyll, and the following steps from this link helped me. Just in case anyone else comes across this!
http://davidensinger.com/2013/03/installing-jekyll/
I was facing the same issue in my Fedora 22 setup. I had ruby installed but didn't have ruby-devel. Installing ruby-devel fixed the issue for me.
dnf install -y ruby-devel
For older systems:
yum install -y ruby-devel
I followed this on Ubuntu/Linux Mint
sudo apt install build-essential
sudo apt install ruby-dev
sudo gem install jekyll
An addendum: You can install XCode now from the App Store on Mountain Lion. The process is transparent and pretty fast.
I had the same problems with you.
I use Mac OS X 10.9 develop preview version, and I had installed gcc and Xcode.
But my Xcode version is 4.6.
Then I install the Xcode 5.0
After that I type sudo gem install jekyll in the terminal again. Then it works.
Wish it could help someone.
Installing Xcode and going to perferencs > downloads > install commandline tools WORKS!
Same problem on Debian, I had forgot to run this command:
~/.rvm/scripts/rvm
All these answers did NOT work for me.
If you're looking for a solution on ubuntu 14.04, do this:
sudo apt-get install ruby1.9.1-dev zlib1g-dev nodejs
sudo gem install jekyll -v 2.5.3
Unfortunately, nodejs is required because of a bug in Jekyll that enforces existence of runtime JS engine even though it doesn't need one.
For Ubuntu, this helped in my case:
apt-get install libffi-dev
A general advice is to just follow what is displayed as the reason for the error and hopefully you'll be provided with a log file in which the first line suggests which package should be installed, in my case:
To see why this extension failed to compile, please check the mkmf.log which can be found here:
/var/lib/gems/2.3.0/extensions/x86_64-linux/2.3.0/ffi-1.9.21/mkmf.log
MacOS
my solution to this problem
install xcode
type xcode-select --install in the command line
type sudo gem install jekyll in the command line
PS: It is the combination of the two answers in this question.
You are missing the ruby-dev file , just go ahead and run this command - sudo apt-get install ruby-dev
Hope this helps!!
I had the same issue on my macOS(10.14.2), the reason may be:
Apparently with OSX el Capitan, there is a new security function that prevents you from modifying system files called Rootless.
My solution is using rvm:
install ruby on Mac OS X with RVM
gem install jekyll
On windows I have this issue
I actually installed the version rubyinstaller-devkit-2.6.3-1-x64 of ruby
I have removed the ruby completely and Installed the rubyinstaller-devkit-2.5.5-1-x64
and issued the following commands on powershell
gem install bundler
gem install jekyll
and this time no errors where found
I had this issue and of all things, the error was occurring because I hadn't agreed to some updated terms of service in xcode. Running the following did the trick for me. Go figure.
sudo xcodebuild -license accept
For me, I had to upgrade homebrew and install rbenv to the latest ruby version. After that, I followed the instruction at jekyll website. My OS is Catalina 2019, I couldn't install Xcode, which is not compatible yet!
You have to set the path in your .bash_profile to make sure that it initializes the rbenv when you restart your terminal.
export PATH="$HOME/.rbenv/bin:$PATH"
eval "$(rbenv init -)"
then
$ rbenv version
2.2.3 (set by /Users/mislav/.rbenv/version)
$ rbenv shell
rbenv: no shell-specific version configured
hope that help!
Here is the (only?) reliable and simple way to install Jekyll on macOS
Install UTM
Install Ubuntu Server
Install Jekyll using Ubuntu instructions at https://jekyllrb.com/docs/installation/ubuntu/
Forward port 22 in the VM settings (22->localhost->22)
Use VS Code on the macOS host
Install Remote SSH
Connect to USER#localhost
Drag and drop the folder on Mac into VS Code (this transfers files to remote)
Enable port forwarding for 4000 (bottom bar on VS Code)
Work on your website
Right click on your website on the file explorer and click download
If you have not done these steps, you might be delighted by:
Ubuntu imports your public SSH key from GitHub
VS Code magically handles file transfer in and out
VS Code magically installs your VS Code extensions onto the remote server and allows file search on the remote host
Related
As per the steps given in fastlane docs, I am not able to install fastlane.
After running brew cask install fastlane, I get this pop up:
If I try to run from gem with sudo gem install fastlane, I get this error:
What I see is the ruby.h file is missing from the directory. As it says in the error, I need to install the ruby-dev environment separately. But I could not find how to do that. I saw apt-get commands for this, but then what about the ruby installed via brew?
ruby -v: ruby 2.6.3p62
brew -v: Homebrew 2.1.10
brew upgrade ruby: ruby 2.6.3 already installed
Since the error says we have to instal ruby as a separate package for development, I had to install rbenv as shown on ROR's website. You can check the full problem and solution here.
Run this to disable Gatekeeper:
sudo spctl --master-disable
Then install and run fastlane. When done, run this to re-enable Gatekeeper:
sudo spctl --master-enable
It will remember that you have permitted the application after re-enabling Gatekeeper and you will not have to run these commands every time you use it.
According to https://github.com/fastlane/fastlane/issues/15183
This is a common issue which nobody can solve it.
In case you can't update fastlane version
try
sudo gem install -n /usr/local/bin fastlane
I'm stuck trying to install rails on my mac. I have OS X 10.6.8 and I have confirmed that I have Ruby, version 1.8.7
I ran sudo gem update and sudo gem update --system to get the latest versions of the software.
However, when I run sudo gem install rails I get this error:
ERROR: Error installing rails:
ERROR: Failed to build gem native extension.
/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/bin/ruby extconf.rb
mkmf.rb can't find header files for ruby at /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/ruby.h
Gem files will remain installed in /Library/Ruby/Gems/1.8/gems/json-1.6.3 for inspection.
Results logged to /Library/Ruby/Gems/1.8/gems/json-1.6.3/ext/json/ext/parser/gem_make.out
If you have XCode 4 or later you will need to open it and go to Preferences -> Downloads -> Components and install the Command Line tools as they aren't installed by default. Couldn't install Rails until this happened.
Im using osx 10.10. You can download from the command-line
xcode-select --install
Not sure what it needs to compile, but OSX can't compile any native ruby extensions at all unless the Apple developer tools are installed. On 10.7 Lion you can download it free from the app store, or Download it here for 10.6: http://developer.apple.com/xcode/index.php
It may also be on your OSX install discs, though probably much more out of date.
Did you install the OS X developer tools? You'll need to do this to be able to build native extensions
Just a follow up ...
it may be that you are on a mac and rails cannot find the right compiler for c headers.
just install xcode from apps store / homebrew or go to terminal ...
$ xcode-select --install
complete the installation and agree on the licensing etc, then ...
$ sudo gem install rails
There are two possible reasons for the fail:
PRIMARY REASON: Missing Xcode Command Line Tools
Verifying Xcode Command Line Tools Installation manually:
Check for presence of
"/usr/include/iconv.h" (if absent=>Missing or improperly installed Xcode CLT)
Installing Xcode CLT:
Try running xcode-select --install on terminal and follow the instructions. If it fails, open Xcode.app, select from menu "Xcode" - "Open Developer Tool" - "More Developer Tools" to open the developer site, download the installer for your OS version and run it.
SECONDARY REASON(if 1. fails): Version issues
Try upgrading the ruby version using rbenv.
Hope it helps!
Steps to sort out this issue:
Follow these steps unless error is fixed.
Open terminal and run commands:
sudo xcode-select --install
sudo xcodebuild -license accept
Make sure you have installed only one Xcode and it is the latest one. If more than one version is installed then keep only the latest one with name in applications like Xcode.app
Open Xcode->preferences->locations then check if any command line tools are selected; if not then select
Install Ruby by:
brew install ruby
Install CocoaPods by
sudo gem install cocoapods
Try to install Ruby via RVM. I solved in this way
How to install ruby on Ubuntu with rvm
The Command line tools didn't solve this issue for me.
I upgraded ruby installation through rbenv to 2.2.0, made that the global default ruby installation, and this issue was fixed.
Switch Ruby to Homebrew version:
$ brew install ruby
$ brew link --overwrite ruby
$ echo 'export PATH="/usr/local/opt/ruby/bin:$PATH"' >> ~/.bash_profile
$ echo 'export LDFLAGS="-L/usr/local/opt/ruby/lib"' >> ~/.bash_profile
$ echo 'export CPPFLAGS="-I/usr/local/opt/ruby/include"' >> ~/.bash_profile
Just had a similar issue. I can confirm that installing the command line tools fixes it.
https://stackoverflow.com/a/58226876/8070378
Solved after run:
sudo xcode-select --install
sudo xcodebuild -license accept
I had this problem on macOS Catalina 10.15.7, and it seems that Xcode 12.3's Ruby is a variant of 2.6, but my software needed 2.7.
I installed rvm and ran rvm install ruby-2.7, and now it works just fine 🎉
I was trying to install rails on Ubuntu Natty Narwhal 11.04, using ruby1.9.1.
I installed ruby using apt-get install ruby1.9.1-full which contains the dev package. I googled the error and all have suggested I install the 1.9.1-dev which I already have.
Building native extensions. This could take a while...
ERROR: Error installing rails:
ERROR: Failed to build gem native extension.
/usr/bin/ruby1.8 extconf.rb
extconf.rb:36:in `require': no such file to load -- mkmf (LoadError)
from extconf.rb:36
Gem files will remain installed in /usr/lib/ruby/gems/1.8/gems/bcrypt-ruby-3.0.1 for inspection.
Results logged to /usr/lib/ruby/gems/1.8/gems/bcrypt-ruby-3.0.1/ext/mri/gem_make.out
After some search for a solution it turns out the -dev package is needed, not just ruby1.8. So if you have ruby1.9.1 doing
sudo apt-get install ruby1.9.1-dev
or to install generic ruby version, use (as per #lamplightdev comment):
sudo apt-get install ruby-dev
should fix it.
Try locate mkmf to see if the file is actually there.
This is the answer that worked for me. Was in the comments above, but deserves its rightful place as answer for ubuntu 12.04 ruby 1.8.7
sudo apt-get install ruby-dev
# if above doesnt work make sure you have build essential
sudo apt-get install build-essential
I also needed build-essential installed:
sudo apt-get install build-essential
The problem is still is recursive on Ubuntu 13/04/13.10/14.04
and
sudo apt-get install ruby1.9.1-dev
worked out for me okay. So If you are using Ubuntu 13.04/13.10/14.04 then using this will really come in handy.
This works even if ruby version is 1.9.3. This is because there is no ruby1.9.3-dev available in the Repository...
Have you tried:
sudo apt-get install ruby1.8-dev
I got the similar error when install bundle
sudo apt-get install ruby-dev
Works great for me and solve the problem
Mint 16 ruby1.9.3
I think is a little late but
sudo yum install -y gcc ruby-devel libxml2 libxml2-devel libxslt libxslt-devel
worked for me on fedora.
http://nokogiri.org/tutorials/installing_nokogiri.html
You've Ruby 1.8 so you need to upgrade to at least 1.9 to make it working.
If so, then check How to install a specific version of a ruby gem?
If this won't help, then reinstalling ruby-dev again.
You can use RVM(Ruby version manager) which helps in managing all versions of ruby on your machine , which is very helpful for you development (when migrating to unstable release to stable release )
or for Linux (ubuntu) go for
sudo apt-get install ruby1.8-dev
then sudo gem install rails to verify it do rails -v it will show version on rails
after that you can install bundles (required gems for development)
Ruby version: 2.7.1
gem version: 3.1.3
You need to check the extension that could not be installed, and find the reasons.
Read the mkmf.log file showed at the installation error under "To see why this extension failed to compile, please check the mkmf.log which can be found here" , perhaps there is a missing lib ( sometimes iconv ), and you must install it.
You can search the extension with your package manager(apt, yum, pacman...) too.
(Personal case) Arch Linux->nokogiri
gem install rails
Showed me:
To see why this extension failed to compile, please check the mkmf.log
which can be found here:
/home/user/.gem/ruby/2.7.0/extensions/x86_64-linux/2.7.0/nokogiri-1.10.9/mkmf.log
Go to: https://aur.archlinux.org/packages/ruby-nokogiri/
Make sure you have all dependencies installed
Make sure you have make installed
git clone the package
cd to package
makepkg the package
Hope to help!
I am getting following error while running local script/server of my Rails project:
This installation of RMagick was configured with ImageMagick 6.6.1 but ImageMagick 6.4.5 is in use. (RuntimeError)
Running identify --version shows the following:
Version: ImageMagick 6.6.1-10 2010-05-21 Q8 http://www.imagemagick.org
So, my question is how and where should I make changes to work it fine; I have already reinstalled ImageMagick but that didn't work.
the same thing happened to me but the solution was a bit simpler than uninstalling imageMagick. It sounds like Rmagick's config file isn't updated to use your updated imagemagick so try
sudo gem uninstall rmagick
sudo gem install rmagick
restart your server.
I took a closer look and noticed you had Rmagick configured for a newer imageMagick but using an older imageMagick. So I would assume that my solution would still work but you would not be using the newer ImageMagick.
If using bundler:
bundle exec gem uninstall rmagick
bundle install (will reinstall rmagick as part of the bundle)
I would remove any previous installation and start again by following this page.
First of all open a shell and launch:
identify -version
which will give you the IM version installed on your system.
Depending on how You installed IM, find the way to remove It completely from the system. For instance if you used apt-get, try:
sudo apt-get remove ImageMagick
If you installed IM from sources, go to where you have them stored (I mean the sources path/folder) and type:
make uninstall
You can then reinstall ImageMagick, compiling it from the sources:
cd
wget ftp://ftp.imagemagick.org/pub/ImageMagick/ImageMagick.tar.gz
tar zxf ImageMagick.tar.gz
cd ImageMagick-*/
./configure --prefix=$HOME --without-perl
make
make install
Then you have to add $HOME/bin to the beginning of your $PATH
cd
echo "export PATH=$HOME/bin:\$PATH" >> .bash_profile
source .bash_profile
Now it's time to gem install RMagick:
export LD_LIBRARY_PATH=$HOME/lib
gem install rmagick
RMAGICK_BYPASS_VERSION_TEST = true
Thats a global flag set before requiring rmagick.
from
https://bugs.launchpad.net/ubuntu/+source/librmagick-ruby/+bug/565461/comments/2
Worked and tested ok for me.
I made it work by uninstalling and then deleting the file listed in the error message (before reinstalling). It seems that uninstalling doesn't always clean up some of the old ".so" files.
I had the same issue, and eventually concluded that my installation of libmagick9-dev
(sudo apt-get install libmagick9-dev ruby1.8-dev) was installing ImageMagick APIs for the lower version. My solution was to uninstall the later versions and go with the Ubuntu packaged versions of ImageMagick and the other libraries.
I bumped into this on a Rails app. I tried Scott Montgomerie's answer, but I couldn't get bundle exec gem to work (not sure why, no time to find out).
What worked for me was a simple bundle update rmagick.
bundle update rmagick worked for me
I'm try to install the SQLite gem on a Fedora 9 Linux box with Ruby 1.8.6, Rails 2.2.2, gem 1.3, and sqlite-3.5.9. Here's the command I'm running and its results:
sudo gem install sqlite3-ruby
Building native extensions. This could take a while...
ERROR: Error installing sqlite3-ruby:
ERROR: Failed to build gem native extension.
/usr/bin/ruby extconf.rb install sqlite3-ruby
can't find header files for ruby.
Gem files will remain installed in /usr/lib/ruby/gems/1.8/gems/sqlite3-ruby-1.2.4 for inspection.
Results logged to /usr/lib/ruby/gems/1.8/gems/sqlite3-ruby-1.2.4/ext/sqlite3_api/gem_make.out
gem_make.out just repeats what was already sent to the console. How can I install this gem?
The SQLite RubyGem isn't actually a RubyGem, it's a "CGem", IOW it's written in C. This means it has to be compiled and linked to the Ruby interpreter when you install it and in order to do that it needs the C header files for the Ruby interpreter.
If you compile Ruby yourself, those header files will be installed automatically, however, in RedHat-ish systems, such header files are usually packaged in a seperate package, called <whatever>-dev. So, in this case you will need to install the ruby-dev package and possibly the libsqlite3-dev (Ubuntu) or sqlite-devel (Fedora) package as well.
However, you might be better off just installing your Operating System's pre-packaged libsqlite3-ruby package, that way all the dependencies are automatically satisfied.
(Note: all package names pulled out of thin air, might be different on your system.)
You probably need the ruby dev package. For Ubuntu you have to install ruby1.8-dev which includes the ruby header files. A quick google says that the yum package is ruby-devel. so run this:
sudo yum install ruby-devel
I faced problem installing sqlite3-ruby gem on my fedora 13 box.
It was fixed after sudo yum install sqlite-devel
When I had that problem:
gem install sqlite3 -v '1.3.9'
Building native extensions. This could take a while...
ERROR: Error installing sqlite3:
ERROR: Failed to build gem native extension.
For me worked, installing the "libsqlite3-dev" with:
apt-get install libsqlite3-dev
sudo apt-get install ruby-dev
Fixed it for me.
On Ubuntu 9 and 10 try:
sudo apt-get install ruby-dev
sudo apt-get install sqlite3-dev
Then run
gem install sqlite3
Run the following for Fedora OS:
yum install rubygem-sqlite3
On alpine, you need to install the sqlite-dev package.
I also faced this same issue, the problem is that your Linux installation requires the development libraries for SQLite3 to be installed in order to build the gem.
Here's how I fixed the issue
Open your terminal and run the following commands
sudo apt-get install sqlite3
sudo apt-get install libsqlite3-dev
And then try installing Sqlite3 gem again using this command
gem install sqlite3
That's all.
I hope this helps
Do you have all the source code required to build sqlite3-ruby? Gem is trying to compile some C code and cannot find the headers. You can probably use a fedora rpm for sqlite3-ruby (I don't use fedora, but I'm sure one exists) if you prefer to forgo compiling. Personally for ruby stuff, I prefer to use gem rather than a distro's packaging system.
I'm not really familiar with Fedora, but in Ubuntu when you are installing packages you have apt-get, and you have to install the build-essentials which includes gcc and other compilation tools for C. I would say that could be your issue, and you make look into how that can be install either using RPM or apt-get on Fedora.
I fixed the problem on my OLPC (Fedora 9) by installing 'gcc' oddly enough. It seems like it should have been one of those dev packages, but no.
Also, regarding the other packages, the suffix is "-devel", not "-dev", so make sure you get those ending right: "ruby-devel", "sqlite-devel"...
Once you get that installed, if you get errors about your gems being too old "< 1.3.1" when you try to run various rails scripts, eg: script/server or script/console, google "upgrade_rubygems" to fix that problem...
HTH...
Run "sudo yum install sqlite-devel" and then "gem install sqlite3". Had the same problem on my Fedora 15.
I had this same exact issue...instead of gem'ing the missing pieces I used synaptic on unbuntu.
The key package for me was libsqlite-ruby1.9.1 ... I documented my experience (for reference) with this error at :
Sqlite3-gem-error-during-bundle-install
I encountered this error while running bundle install after generating a react-rails app on Fedora 29. I was able to identify a suitable development package by running dnf search sqlite3, then installed it dnf install libsqlite3x-devel. This fixed it for me.