Help regarding installation of Gems

210 views
Skip to first unread message

Prasanna Moharana

unread,
Sep 14, 2015, 6:04:22 AM9/14/15
to Ruby on Rails: Talk

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..

Colin Law

unread,
Sep 14, 2015, 6:21:04 AM9/14/15
to Ruby on Rails: Talk
On 14 September 2015 at 11:00, Prasanna Moharana <lipp.p...@gmail.com> wrote:

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


 

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..

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-ta...@googlegroups.com.
To post to this group, send email to rubyonra...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/000e21cf-421f-488a-93b6-0d0da43addb4%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Prasanna Moharana

unread,
Sep 14, 2015, 6:56:52 AM9/14/15
to Ruby on Rails: Talk
Hello am using Ubuntu 14.04,and i have  prefer  this

Colin Law

unread,
Sep 14, 2015, 7:10:58 AM9/14/15
to Ruby on Rails: Talk
On 14 September 2015 at 11:56, Prasanna Moharana
<lipp.p...@gmail.com> wrote:
>
> 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
> --
> You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-ta...@googlegroups.com.
> To post to this group, send email to rubyonra...@googlegroups.com.
> To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/700b7370-1f64-43eb-98cd-94f654996e4b%40googlegroups.com.

Prasanna Moharana

unread,
Sep 14, 2015, 7:15:32 AM9/14/15
to Ruby on Rails: Talk
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...

Prasanna Moharana

unread,
Sep 14, 2015, 7:29:02 AM9/14/15
to Ruby on Rails: Talk
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.


On Monday, September 14, 2015 at 3:34:22 PM UTC+5:30, Prasanna Moharana wrote:

Colin Law

unread,
Sep 14, 2015, 8:26:14 AM9/14/15
to Ruby on Rails: Talk
On 14 September 2015 at 12:15, Prasanna Moharana
<lipp.p...@gmail.com> wrote:
> 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...

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

Colin Law

unread,
Sep 14, 2015, 8:29:01 AM9/14/15
to Ruby on Rails: Talk
On 14 September 2015 at 12:29, Prasanna Moharana
<lipp.p...@gmail.com> wrote:
>
> 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

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

Prasanna Moharana

unread,
Sep 14, 2015, 8:55:42 AM9/14/15
to Ruby on Rails: Talk
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.



On Monday, September 14, 2015 at 3:34:22 PM UTC+5:30, Prasanna Moharana wrote:

Colin Law

unread,
Sep 14, 2015, 9:05:50 AM9/14/15
to Ruby on Rails: Talk
On 14 September 2015 at 13:55, Prasanna Moharana
<lipp.p...@gmail.com> wrote:
>
> 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?

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

Prasanna Moharana

unread,
Sep 14, 2015, 9:21:48 AM9/14/15
to Ruby on Rails: Talk

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-<name> --url https://github.com/github/ruby.git --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




On Monday, September 14, 2015 at 3:34:22 PM UTC+5:30, Prasanna Moharana wrote:

Colin Law

unread,
Sep 14, 2015, 9:49:47 AM9/14/15
to Ruby on Rails: Talk
On 14 September 2015 at 14:21, Prasanna Moharana
<lipp.p...@gmail.com> wrote:
>
>
> ok please have a look -

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

Norbert Melzer

unread,
Sep 14, 2015, 1:53:19 PM9/14/15
to rubyonra...@googlegroups.com

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.


--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-ta...@googlegroups.com.
To post to this group, send email to rubyonra...@googlegroups.com.

Colin Law

unread,
Sep 14, 2015, 3:41:39 PM9/14/15
to Ruby on Rails: Talk
On 14 September 2015 at 18:52, Norbert Melzer <timm...@gmail.com> wrote:

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
 

Norbert Melzer

unread,
Sep 14, 2015, 5:00:30 PM9/14/15
to Ruby on Rails: Talk

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?


--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-ta...@googlegroups.com.
To post to this group, send email to rubyonra...@googlegroups.com.

Colin Law

unread,
Sep 15, 2015, 3:53:02 AM9/15/15
to Ruby on Rails: Talk
On 14 September 2015 at 21:59, Norbert Melzer <timm...@gmail.com> wrote:
> 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
> https://groups.google.com/d/msgid/rubyonrails-talk/CA%2BbCVsv9ERDX4iiJXy%3Duv8CQL9tXAOHET8J3mk-%2Bb70FDp49SA%40mail.gmail.com.

Prasanna Moharana

unread,
Sep 18, 2015, 6:02:04 PM9/18/15
to Ruby on Rails: Talk
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 http://in.archive.ubuntu.com/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..


On Monday, September 14, 2015 at 3:34:22 PM UTC+5:30, Prasanna Moharana wrote:

Colin Law

unread,
Sep 19, 2015, 2:56:39 AM9/19/15
to Ruby on Rails: Talk
On 18 September 2015 at 23:02, Prasanna Moharana <lipp.p...@gmail.com> wrote:
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 http://in.archive.ubuntu.com/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
 

Prasanna Moharana

unread,
Sep 19, 2015, 6:58:26 AM9/19/15
to Ruby on Rails: Talk
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 `<main>'


so i please help me to get over this..



On Monday, September 14, 2015 at 3:34:22 PM UTC+5:30, Prasanna Moharana wrote:

Colin Law

unread,
Sep 19, 2015, 8:37:53 AM9/19/15
to Ruby on Rails: Talk
On 19 September 2015 at 11:58, Prasanna Moharana <lipp.p...@gmail.com> wrote:
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

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

Colin Law

unread,
Sep 19, 2015, 8:46:06 AM9/19/15
to Ruby on Rails: Talk
On 19 September 2015 at 13:36, Colin Law <cla...@gmail.com> wrote:
> On 19 September 2015 at 11:58, Prasanna Moharana <lipp.p...@gmail.com>
> wrote:
>>
>> 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

Colin

Prasanna Moharana

unread,
Sep 20, 2015, 3:37:05 PM9/20/15
to Ruby on Rails: Talk
Hello colin as u told me to send some data relavant to your command let me give a Result of command that i tried

prasanna@prasanna-HP-Pavilion-dv6-Notebook-PC:~$ gem -v
2.4.8

prasanna@prasanna-HP-Pavilion-dv6-Notebook-PC:~$ which gem
/home/prasanna/.rvm/rubies/ruby-2.2.3/bin/gem

prasanna@prasanna-HP-Pavilion-dv6-Notebook-PC:~$ apt-cache policy libxml2
libxml2:
  Installed: 2.9.1+dfsg1-3ubuntu4.4
  Candidate: 2.9.1+dfsg1-3ubuntu4.4
  Version table:
 *** 2.9.1+dfsg1-3ubuntu4.4 0
        500 http://in.archive.ubuntu.com/ubuntu/ trusty-updates/main amd64 Packages
        500 http://security.ubuntu.com/ubuntu/ trusty-security/main amd64 Packages
        100 /var/lib/dpkg/status
     2.9.1+dfsg1-3ubuntu4 0

        500 http://in.archive.ubuntu.com/ubuntu/ trusty/main amd64 Packages

This is what  all i got ..

On Monday, September 14, 2015 at 3:34:22 PM UTC+5:30, Prasanna Moharana wrote:

Colin Law

unread,
Sep 21, 2015, 4:20:53 AM9/21/15
to Ruby on Rails: Talk
On 20 September 2015 at 20:37, Prasanna Moharana
<lipp.p...@gmail.com> wrote:
>
> Hello colin as u told me to send some data relavant to your command let me give a Result of command that i tried
>
> prasanna@prasanna-HP-Pavilion-dv6-Notebook-PC:~$ gem -v
> 2.4.8
>
> prasanna@prasanna-HP-Pavilion-dv6-Notebook-PC:~$ which gem
> /home/prasanna/.rvm/rubies/ruby-2.2.3/bin/gem



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.

curl -L https://get.rvm.io | bash -s stable --rails

You might have to put your password in if rvm needs to install any
system libraries or tools.
If any errors are thrown up then let us know.

You should already have added the line to load rvm on login onto the
end of .bashrc (as in the tutorial) so won't need to do that again.

logout and in again.

So now
rvm notes
rails -v
ruby -v
gem -v
should all work and show versions picked up from the .rvm folder in
your home directory.

Good luck

Colin

Norbert Melzer

unread,
Sep 21, 2015, 4:37:21 AM9/21/15
to Ruby on Rails: Talk

Please make sure you have also installed libxml2-dev, notice the suffix!


--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-ta...@googlegroups.com.
To post to this group, send email to rubyonra...@googlegroups.com.

Colin Law

unread,
Sep 21, 2015, 4:50:21 AM9/21/15
to Ruby on Rails: Talk
On 21 September 2015 at 09:36, Norbert Melzer <timm...@gmail.com> wrote:
> Please make sure you have also installed libxml2-dev, notice the suffix!

I believe that has already been checked earlier in the thread.

Colin
> https://groups.google.com/d/msgid/rubyonrails-talk/CA%2BbCVstdUgf%3D4JY-61GrTU7p6OjMrB5Gx-T2oQKAeOY1ZL6sRA%40mail.gmail.com.

Norbert Melzer

unread,
Sep 21, 2015, 6:03:20 AM9/21/15
to rubyonra...@googlegroups.com

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.


Colin Law

unread,
Sep 21, 2015, 6:15:10 AM9/21/15
to Ruby on Rails: Talk
On 21 September 2015 at 11:02, Norbert Melzer <timm...@gmail.com> wrote:
> 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
> https://groups.google.com/d/msgid/rubyonrails-talk/CA%2BbCVsvSXDDQr3YkFpNnqTSCw-%2BP6jadp3gn8Y3UYmrbmwg_jg%40mail.gmail.com.

Prasanna Moharana

unread,
Sep 22, 2015, 6:28:00 AM9/22/15
to Ruby on Rails: Talk
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

Colin Law

unread,
Sep 22, 2015, 6:44:22 AM9/22/15
to Ruby on Rails: Talk
On 22 September 2015 at 11:28, Prasanna Moharana
<lipp.p...@gmail.com> wrote:
> 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
https://en.wikipedia.org/wiki/Posting_style

Colin
> https://groups.google.com/d/msgid/rubyonrails-talk/d3441fe2-7119-41f2-af08-32ad207e20be%40googlegroups.com.

Erik Miranda

unread,
Sep 27, 2015, 8:11:42 AM9/27/15
to Ruby on Rails: Talk
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.

The first time I had tried installing rails, I was following the guide on https://gorails.com/setup/ubuntu/14.04 which prescribes calling,


curl -L https://get.rvm.io | bash -s stable

(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.

Cheers,
Erik

Peter Williams

unread,
Sep 28, 2015, 6:34:47 AM9/28/15
to Ruby on Rails: Talk

There are 2 problems:

  1. 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.
  2. 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



Dowload and install "chruby"  (https://github.com/postmodern/chruby)

# cd /home/declan/tmp/
wget
-O chruby-0.3.9.tar.gz https://github.com/postmodern/chruby/archive/v0.3.9.tar.gz
tar
-xzvf chruby-0.3.9.tar.gz
cd chruby
-0.3.9/


# install (to local dir .. dont need sudo)
# dont use setup.sh ...see below

> PREFIX=/home/declan/dev/web_framework/rails/chruby/0.3.9/ make install


# !! dont do this since it adds a "chruby.h" file to /etc/profile.d/ which causes share/chruby/auto.sh to get run each system boot .. dont want this
# sudo /home/declan/tmp/chruby-0.3.9/scripts/setup.sh 
# by default installs to "/usr/local/share/chruby/"

# edit chruby.sh to tell it about our custom ruby
# /home/declan/dev/web_framework/rails/chruby/0.3.9/share/chruby/chruby.sh

RUBIES+=("/home/declan/dev/web_framework/rails/ruby/2.2.3/")


Now you have a clean locally installed version of rails (which is independent of any system version), which you can "activate via 

> source /home/declan/dev/web_framework/rails/chruby/0.3.9/share/chruby/chruby.sh
> chruby 2.2.3
> ruby --version          # 2.2.3
> gem install rubygems-update  # update gem itself

 

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:


> gem install nokogiri -- --use-system-libraries

Now install rails itself

> gem install rails  
> rails --version
 
Rails 4.2.4



Colin Law

unread,
Sep 28, 2015, 8:48:41 AM9/28/15
to Ruby on Rails: Talk
On 28 September 2015 at 11:32, Peter Williams <p8m...@googlemail.com> wrote:
>
> There are 2 problems:
>
> 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.

Using rvm to install ruby and rails has always worked fine for me on
various versions of Ubuntu. I have found no need to do otherwise.

Colin
Reply all
Reply to author
Forward
0 new messages