Hello @colin when i tried to ru gem install nokogiri -v '1.6.6.2' --
--use-system-libraries --with-xml2-include=/usr/include/libxml2
--with-xml2-lib=/usr/lib
command with out using Sudo i got this message-Error installing
nokogiri:
ERROR: Failed to build gem native extension. Its kind of error that
extconf.rb
so after that i tried gem install rails but the same error.
If Any mistake made by me then please help me to correct on this.
I am starting to run out of ideas, but before we use the sledgehammer
approach, what is shown by the commands
gem -v
and
which gem
Also what does this give you
apt-cache policy libxml2
I notice that you have not followed my request to reply to the
previous message when replying and insert your reply inline within or
after the previous message so that it makes it easier to follow the
thread. I offer support on a number of lists and anything you can do
to make life easier for me will make it more likely that I will try to
help. Thanks.
Those look a little odd, as I have just installed on a 14.04 system
using rvm in a similar way to that in the tutorial you linked to and I
have ended up with ruby 2.2.1 (not 2.2.3) and gem 2.4.6 (not 2.4.8).
I don't know how you achieved that but it should not really matter.
However, all else having failed I think the only option is to use the
sledgehammer. I suggest you entirely remove rvm by
rm -rf ~/.rvm* ~/.gem/ ~/.bundle
Some of those may not exist so don't worry if it does not find them to delete.
Tell gem that we don't need to install the docs
echo 'gem: --no-rdoc --no-ri' > ~/.gemrc
Remove the Ubuntu version of gem if you have somehow installed it
sudo apt-get purge gem
Now install ruby and rails using rvm - Note never use sudo for
installing rails related stuff except for installing system libraries
and so on with apt-get. Otherwise you end up with things owned by
root and in the wrong folders.
Sorry, that answer was to the wrong mail, because of some flaws of Google's
inbox mailclient.
In fact he only checked for libxml2, not for libxml2-dev as far as I
understand ops answer.
In his post of 18th Sept
Though @coli u had told me to try out sudo apt-get install libxslt1-dev libxml2-dev command ,its working fine showing that
libxslt1-dev is already the newest version.
libxml2-dev is already the newest version.
0 upgraded, 0 newly installed, 0 to remove and 490 not upgraded.
It is a bit odd that he does not seem to be keeping his system up to
date (490 not upgraded), but I would think that is not likely to be an
issue. However:
@Prassanna unless you have a good reason you should keep your system
up to date using the software updater or by
sudo apt-get update && sudo apt-get dist-upgrade
Hello @colin …Though i know there are some issue in resolving installation .so can you please prefer me any video tutorial link that will be more fruitful for me…cause am a begineer so i dont want to take any risk…so please help me…Thanks
Hello @colin ..Though i know there are some issue in resolving installation
.so can you please prefer me any video tutorial link that will be more
fruitful for me..cause am a begineer so i dont want to take any risk..so
please help me..Thanks
In my one of my posts yesterday I provided detailed instructions on
how to remove rvm and start again. I also asked for, I believe, the
third time, that you help to make it easier for me by inserting your
reply at appropriate points in the previous posting, yet you continue
to top post. Look back at the post yesterday on removing and
installing with rvm again, read it and make sure you understand it.
However, make sure that you follow my request to insert your replies
at appropriate points in the previous message if you want me to help
further.
If you don't understand what I mean by top posting and inserting
replies inline then have a look at
I thought I would just chime in to say that I was (seemingly) having the same problem as described by Prasanna, and the “sledgehammer” approach described by Colin has solved it for me.
(without --rails), and calling “gem install rails” later. I’m not entirely sure why that borks things. My guess is that the script when called with --rails installs whatever magic package I was missing.
Even though installing ruby seems possible without source files (eg ruby.h) using eg rvm, ruby-install etc, subsequently installing rails as a gem requires these files. To avoid version mismatch with the versions from your os (package manager eg yum, yast, apt) its best to build ruby from source.
nokogiri seems to have a bug. Installing rails as a ruby gem fails because of nokogiri wanting to bring in its own version of some dev fies (eg libxml2, libxslt). So you should install nokogiri separately first explicitly telling it not to use these files.
Download Ruby - build from source
Make sure in your os package manager (yum, yast, apt etc) that you install any prerequisites for building c fies eg
c compiler, make, etc
Additionally make sure the following are installed:
libxml2-devel, libxslt-devel (for nokogiri)
nodejs for runtime (server)
cd ~/declan/Downloads/ruby-2.2.3
#create dir below first manually as user “declan” otherwise they will automatically get created belonging to root
./configure --prefix=/home/declan/dev/web_framework/rails/ruby/2.2.3/
make
sudo make install
One should be able to install rails as a gem now, but apparently nokogiri bringing its own versions of files like libxml2-devel, libxslt-devel causes error messages like youre having, so manually install it first explicitly telling it not to use these: