Help regarding installation of Gems

Hello every body am very new to this group. i have some issue regarding Rails installation.Though i have installed Ruby,bundler etc i was trying to install rails using gem install rails command but there are some error like

ERROR: Error installing rails: ERROR: Failed to build gem native extension.

/home/prasanna/.rvm/rubies/ruby-2.2.3/bin/ruby -r ./siteconf20150914-3856-mtv6bq.rb extconf.rb

checking if the C compiler accepts … *** 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.

Provided configuration options: –with-opt-dir –without-opt-dir –with-opt-include –without-opt-include=${opt-dir}/include –with-opt-lib –without-opt-lib=${opt-dir}/lib –with-make-prog –without-make-prog –srcdir=. –curdir –ruby=/home/prasanna/.rvm/rubies/ruby-2.2.3/bin/$(RUBY_BASE_NAME) –help –clean

so can any body please help me to tackle this…

PS.Tried -sudo apt-get install mkmf , gem install mkmf build essential command etc…so please help me to get rid of these…

<https://lh3.googleusercontent.com/-k2GxhXioxdY/VfaavXNSucI/AAAAAAAAARc/0ECId5N62jU/s1600/Screenshot%2Bfrom%2B2015-09-14%2B12%253A55%253A28.png&gt; Hello every body am very new to this group. i have some issue regarding Rails installation.Though i have installed Ruby,bundler etc i was trying to install rails using gem install rails command but there are some error like

ERROR: Error installing rails:     ERROR: Failed to build gem native extension.

    /home/prasanna/.rvm/rubies/ruby-2.2.3/bin/ruby -r ./siteconf20150914-3856-mtv6bq.rb extconf.rb checking if the C compiler accepts ... *** 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.

You have forgotten to tell us which operating system you are using.

I see you are using rvm, usually that will install the dependencies for you. Did you install rvm using the recommended method curl -L https://get.rvm.io | bash -s stable --rails

Colin

Hello am using Ubuntu 14.04,and i have prefer this

http://blog.coolaj86.com/articles/installing-ruby-on-ubuntu-12-04.html so please help me how to tackle this.

Hello am using Ubuntu 14.04,and i have prefer this

http://blog.coolaj86.com/articles/installing-ruby-on-ubuntu-12-04.html so please help me how to tackle this.

That looks ok. What does the command rvm requirements show?

Colin

Everything seems ok in RVM it shows me- Checking requirements for ubuntu. Requirements installation successful. But issue in Rails installation pls see the above picture and help me…

well when i was trying to run sudo apt-get install mkmf it showing me Reading package lists… Done Building dependency tree
Reading state information… Done E: Unable to locate package mkmf

cause i know there are issue in mkmf files. so when i tried to run build essential -. by putting this- sudo apt-get install build-essential the error arise like -checking if the C compiler accepts … *** 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.

It would help me if you could insert your reply at appropriate points in the previous message as I am doing, it makes it easier to follow the thread. Thanks.

Can you copy/paste the full command you are entering with the full results please.

Colin

mkmf is not a package to install. The error was telling you that more information may be found in the log file mkmf.log. In practice it is unlikely that this will help.

Colin

So i think if mkmf file issue will sort out then everything will goes well…so can you help me to how could mkmf file issue resolve? please send me some of the commands that can be helpful. i have tried out sudo apt-get install libmagickwand-dev gem update --system sudo apt-get install ruby-dev sudo apt-get install mkmf and many more command have tried but the same issue.

As I suggested previously please reply with your message after the relevant bits of the one you are replying to. Thanks.

As I said previously mkmf.log is a log file produced by the make, but it is unlikely to help. Did you see my previous message where I asked you to copy/paste the full command and result of the command you are using to install rails?

Colin

ok please have a look - prasanna@prasanna-HP-Pavilion-dv6-Notebook-PC:~/rubyinstaller$ sudo apt-get install ruby-dev zlib1g-dev Reading package lists… Done Building dependency tree
Reading state information… Done ruby-dev is already the newest version. zlib1g-dev is already the newest version. 0 upgraded, 0 newly installed, 0 to remove and 486 not upgraded.

prasanna@prasanna-HP-Pavilion-dv6-Notebook-PC:~/rubyinstaller$ ruby -v ruby 2.2.3p173 (2015-08-18 revision 51636) [x86_64-linux]

prasanna@prasanna-HP-Pavilion-dv6-Notebook-PC:~/rubyinstaller$ gem install mkmf ERROR: Could not find a valid gem ‘mkmf’ (>= 0) in any repository

prasanna@prasanna-HP-Pavilion-dv6-Notebook-PC:~/rubyinstaller$ gem update --system Latest version currently installed. Aborting.

prasanna@prasanna-HP-Pavilion-dv6-Notebook-PC:~/rubyinstaller$ rvm list known

MRI Rubies

[ruby-]1.8.6[-p420] [ruby-]1.8.7[-head] # security released on head [ruby-]1.9.1[-p431] [ruby-]1.9.2[-p330] [ruby-]1.9.3[-p551] [ruby-]2.0.0[-p643] [ruby-]2.1.4 [ruby-]2.1[.5] [ruby-]2.2[.1] [ruby-]2.2-head ruby-head

for forks use: rvm install ruby-head- --url GitHub - github/ruby: fork of ruby/ruby --branch 2.1

JRuby

jruby-1.6.8 jruby[-1.7.19] jruby-head jruby-9.0.0.0.pre1

Rubinius

rbx-1.4.3 rbx-2.4.1 rbx[-2.5.2] rbx-head

Opal

opal

Minimalistic ruby implementation - ISO 30170:2012

mruby[-head]

Ruby Enterprise Edition

ree-1.8.6 ree[-1.8.7][-2012.02]

GoRuby

goruby

Topaz

topaz

MagLev

maglev[-head] maglev-1.0.0

Mac OS X Snow Leopard Or Newer

macruby-0.10 macruby-0.11 macruby[-0.12] macruby-nightly macruby-head

IronRuby

ironruby[-1.1.3] ironruby-head

prasanna@prasanna-HP-Pavilion-dv6-Notebook-PC:~/rubyinstaller$ locate mkmf /home/prasanna/.rbenv/versions/2.2.3/lib/ruby/2.2.0/mkmf.rb /home/prasanna/.rbenv/versions/2.2.3/lib/ruby/gems/2.2.0/extensions/x86_64-linux/2.2.0-static/eventmachine-1.0.8/mkmf.log /home/prasanna/.rbenv/versions/2.2.3/lib/ruby/gems/2.2.0/extensions/x86_64-linux/2.2.0-static/ffi-1.9.10/mkmf.log /home/prasanna/.rbenv/versions/2.2.3/lib/ruby/gems/2.2.0/extensions/x86_64-linux/2.2.0-static/nokogiri-1.6.6.2/mkmf.log /home/prasanna/.rvm/gems/ruby-2.2.3/extensions/x86_64-linux/2.2.0/nokogiri-1.6.6.2/mkmf.log /home/prasanna/.rvm/rubies/ruby-1.9.3-p551/lib/ruby/1.9.1/mkmf.rb /home/prasanna/.rvm/rubies/ruby-2.2.3/lib/ruby/2.2.0/mkmf.rb /home/prasanna/.rvm/src/ruby-1.9.3-p551/ext/-test-/array/resize/mkmf.log /home/prasanna/.rvm/src/ruby-1.9.3-p551/ext/-test-/bug-3571/mkmf.log /home/prasanna/.rvm/src/ruby-1.9.3-p551/ext/-test-/bug-3662/mkmf.log /home/prasanna/.rvm/src/ruby-1.9.3-p551/ext/-test-/funcall/mkmf.log /home/prasanna/.rvm/src/ruby-1.9.3-p551/ext/-test-/load/dot.dot/mkmf.log /home/prasanna/.rvm/src/ruby-1.9.3-p551/ext/-test-/old_thread_select/mkmf.log /home/prasanna/.rvm/src/ruby-1.9.3-p551/ext/-test-/st/numhash/mkmf.log /home/prasanna/.rvm/src/ruby-1.9.3-p551/ext/-test-/string/mkmf.log /home/prasanna/.rvm/src/ruby-1.9.3-p551/ext/-test-/wait_for_single_fd/mkmf.log /home/prasanna/.rvm/src/ruby-1.9.3-p551/ext/-test-/win32/dln/mkmf.log /home/prasanna/.rvm/src/ruby-1.9.3-p551/ext/-test-/win32/fd_setsize/mkmf.log /home/prasanna/.rvm/src/ruby-1.9.3-p551/ext/bigdecimal/mkmf.log /home/prasanna/.rvm/src/ruby-1.9.3-p551/ext/continuation/mkmf.log /home/prasanna/.rvm/src/ruby-1.9.3-p551/ext/coverage/mkmf.log /home/prasanna/.rvm/src/ruby-1.9.3-p551/ext/curses/mkmf.log /home/prasanna/.rvm/src/ruby-1.9.3-p551/ext/date/mkmf.log /home/prasanna/.rvm/src/ruby-1.9.3-p551/ext/dbm/mkmf.log /home/prasanna/.rvm/src/ruby-1.9.3-p551/ext/digest/mkmf.log /home/prasanna/.rvm/src/ruby-1.9.3-p551/ext/digest/bubblebabble/mkmf.log /home/prasanna/.rvm/src/ruby-1.9.3-p551/ext/digest/md5/mkmf.log /home/prasanna/.rvm/src/ruby-1.9.3-p551/ext/digest/rmd160/mkmf.log /home/prasanna/.rvm/src/ruby-1.9.3-p551/ext/digest/sha1/mkmf.log /home/prasanna/.rvm/src/ruby-1.9.3-p551/ext/digest/sha2/mkmf.log /home/prasanna/.rvm/src/ruby-1.9.3-p551/ext/dl/mkmf.log /home/prasanna/.rvm/src/ruby-1.9.3-p551/ext/dl/callback/mkmf.log /home/prasanna/.rvm/src/ruby-1.9.3-p551/ext/dl/win32/mkmf.log /home/prasanna/.rvm/src/ruby-1.9.3-p551/ext/etc/mkmf.log /home/prasanna/.rvm/src/ruby-1.9.3-p551/ext/fcntl/mkmf.log /home/prasanna/.rvm/src/ruby-1.9.3-p551/ext/fiber/mkmf.log /home/prasanna/.rvm/src/ruby-1.9.3-p551/ext/fiddle/mkmf.log /home/prasanna/.rvm/src/ruby-1.9.3-p551/ext/gdbm/mkmf.log /home/prasanna/.rvm/src/ruby-1.9.3-p551/ext/iconv/mkmf.log /home/prasanna/.rvm/src/ruby-1.9.3-p551/ext/io/console/mkmf.log /home/prasanna/.rvm/src/ruby-1.9.3-p551/ext/io/nonblock/mkmf.log /home/prasanna/.rvm/src/ruby-1.9.3-p551/ext/io/wait/mkmf.log /home/prasanna/.rvm/src/ruby-1.9.3-p551/ext/json/mkmf.log /home/prasanna/.rvm/src/ruby-1.9.3-p551/ext/json/generator/mkmf.log /home/prasanna/.rvm/src/ruby-1.9.3-p551/ext/json/parser/mkmf.log /home/prasanna/.rvm/src/ruby-1.9.3-p551/ext/mathn/complex/mkmf.log /home/prasanna/.rvm/src/ruby-1.9.3-p551/ext/mathn/rational/mkmf.log /home/prasanna/.rvm/src/ruby-1.9.3-p551/ext/nkf/mkmf.log /home/prasanna/.rvm/src/ruby-1.9.3-p551/ext/objspace/mkmf.log /home/prasanna/.rvm/src/ruby-1.9.3-p551/ext/openssl/mkmf.log /home/prasanna/.rvm/src/ruby-1.9.3-p551/ext/pathname/mkmf.log /home/prasanna/.rvm/src/ruby-1.9.3-p551/ext/psych/mkmf.log /home/prasanna/.rvm/src/ruby-1.9.3-p551/ext/pty/mkmf.log /home/prasanna/.rvm/src/ruby-1.9.3-p551/ext/racc/cparse/mkmf.log /home/prasanna/.rvm/src/ruby-1.9.3-p551/ext/readline/mkmf.log /home/prasanna/.rvm/src/ruby-1.9.3-p551/ext/ripper/mkmf.log /home/prasanna/.rvm/src/ruby-1.9.3-p551/ext/sdbm/mkmf.log /home/prasanna/.rvm/src/ruby-1.9.3-p551/ext/socket/mkmf.log /home/prasanna/.rvm/src/ruby-1.9.3-p551/ext/stringio/mkmf.log /home/prasanna/.rvm/src/ruby-1.9.3-p551/ext/strscan/mkmf.log /home/prasanna/.rvm/src/ruby-1.9.3-p551/ext/syck/mkmf.log /home/prasanna/.rvm/src/ruby-1.9.3-p551/ext/syslog/mkmf.log /home/prasanna/.rvm/src/ruby-1.9.3-p551/ext/tk/mkmf.log /home/prasanna/.rvm/src/ruby-1.9.3-p551/ext/tk/tkutil/mkmf.log /home/prasanna/.rvm/src/ruby-1.9.3-p551/ext/win32ole/mkmf.log /home/prasanna/.rvm/src/ruby-1.9.3-p551/ext/zlib/mkmf.log /home/prasanna/.rvm/src/ruby-1.9.3-p551/lib/mkmf.rb /home/prasanna/.rvm/src/ruby-1.9.3-p551/test/mkmf /home/prasanna/.rvm/src/ruby-1.9.3-p551/test/mkmf/base.rb /home/prasanna/.rvm/src/ruby-1.9.3-p551/test/mkmf/test_convertible.rb /home/prasanna/.rvm/src/ruby-1.9.3-p551/test/mkmf/test_find_executable.rb /home/prasanna/.rvm/src/ruby-1.9.3-p551/test/mkmf/test_flags.rb /home/prasanna/.rvm/src/ruby-1.9.3-p551/test/mkmf/test_framework.rb /home/prasanna/.rvm/src/ruby-1.9.3-p551/test/mkmf/test_signedness.rb /home/prasanna/.rvm/src/ruby-1.9.3-p551/test/mkmf/test_sizeof.rb

Please post your reply inline in the previous message as I have asked multiple times. If you want me to help then do this.

Please also read more carefully what I am asking for. I asked for the command and output for the command that you are using to try to install rails, not the result of all the commands that work ok.

Colin

Install gcc, it’s obvious by just looking at which point mkmf cancels… Probably you will stumble over more missing development packages after that, but let’s make one step after the other.

He said he had already done sudo apt-get install build-essential and that rvm requirements said that all is installed, so if gcc is not installed then it is a little strange.

@Prasanna what does apt-cache policy gcc show?

Colin

OK, I have taken a closer look into the posted screenshot. It seems to happen when installing nokogiri, what were the names of the development headers it depends on?

OK, I have taken a closer look into the posted screenshot. It seems to happen when installing nokogiri, what were the names of the development headers it depends on?

I had missed that, I do not display images by default and had not even noticed that there was an image as no reference was made to it in the text.

@Prasanna try sudo apt-get install libxslt1-dev libxml2-dev and try installing rails again.

Colin

Hello sorry @colin .i am a new one to this forum as well as ruby so if any mistake made by me then i am sorry. well the output of $ apt-cache policy gcc is gcc: Installed: 4:4.8.2-1ubuntu6 Candidate: 4:4.8.2-1ubuntu6 Version table: *** 4:4.8.2-1ubuntu6 0 500 Index of /ubuntu trusty/main amd64 Packages 100 /var/lib/dpkg/status

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.

And after it i try to install rails by gems install rails but the same error again comes up. i had try to install nokogiri by trying out sudo gem install nokogiri -v ‘1.6.6.2’ – --use-system-libraries --with-xml2-include=/usr/include/libxml2 --with-xml2-lib=/usr/lib command & it was working fine. So help me guys…

Sine you are using rvm you should not use sudo for install gems, otherwise it does not install to the correct place.

I don't know why you should need those options to install nokogiri. What happens if you just try that command without the sudo?

If that works can you now install rails using gem install rails

Colin

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.

if i use sudo gem install rails, its showing 31 gems already installed,but when i type rails -v it showing me

/usr/lib/ruby/1.9.1/rubygems/dependency.rb:247:in to_specs': Could not find railties (>= 0) amongst [activesupport-4.2.4, bundler-1.10.6, bundler-unload-1.0.2, executable-hooks-1.3.2, gem-wrappers-1.2.7, i18n-0.7.0, mini_portile-0.6.2, minitest-5.8.0, rails-deprecated_sanitizer-1.0.3, rubygems-bundler-1.4.4, rvm-1.11.3.9, thread_safe-0.3.5, tzinfo-1.2.2] (Gem::LoadError) from /usr/lib/ruby/1.9.1/rubygems/dependency.rb:256:in to_spec’ from /usr/lib/ruby/1.9.1/rubygems.rb:1231:in gem' from /usr/local/bin/rails:22:in

so i please help me to get over 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

Please when posting back results copy/paste the full results with the command you entered) rather than re-typing bits of it. Sometimes bits that you consider not relevant may be important.

Also if you could post your reply back inline in the previous message so that your answer follows the question that would make it easier to follow the thread. Thanks. If you are using the gmail web browser interface then clicking the three dots at the bottom left of the text window when replying will show the previous message so you can insert your reply at the appropriate place.

Colin