Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Ubuntu 14.04 Rails missing file

when installing Rails, everything was good but then, i write:

rails -v

and the output:

/home/toshiba/.rvm/rubies/ruby-2.2.1/lib/ruby/site_ruby/2.2.0/rubygems/core_ext/kernel_require.rb:54:in `require': cannot load such file -- rails/cli (LoadError)
from /home/toshiba/.rvm/rubies/ruby-2.2.1/lib/ruby/site_ruby/2.2.0/rubygems/core_ext/kernel_require.rb:54:in `require'
from /usr/bin/rails:7:in `<main>'

everyone know how to do it?

I used this tutorial: http://installfest.railsbridge.org/

and yes, i run:

gem install rails

I noticed that when i run install rails this thing is pop up

Building native extensions.  This could take a while...
ERROR:  Error installing rails:
ERROR: Failed to build gem native extension.

/home/toshiba/.rvm/rubies/ruby-2.2.1/bin/ruby -r ./siteconf20150816-3818-sm5w21.rb extconf.rb
checking if the C compiler accepts -ggdb3 -O0 -std=c99 -Wall -Werror... yes
Building nokogiri using packaged libraries.
checking for gzdopen() in -lz... no
zlib is missing; necessary for building libxml2
*** 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/toshiba/.rvm/rubies/ruby-2.2.1/bin/$(RUBY_BASE_NAME)
--help
--clean
--use-system-libraries
--enable-static
--disable-static
--with-zlib-dir
--without-zlib-dir
--with-zlib-include
--without-zlib-include=${zlib-dir}/include
--with-zlib-lib
--without-zlib-lib=${zlib-dir}/lib
--enable-cross-build
--disable-cross-build

extconf failed, exit code 1

Gem files will remain installed in /home/toshiba/.rvm/gems/ruby-2.2.1/gems/nokogiri-1.6.6.2 for inspection.
Results logged to /home/toshiba/.rvm/gems/ruby-2.2.1/extensions/x86_64-linux/2.2.0/nokogiri-1.6.6.2/gem_make.out

It seems bad

like image 436
Luís Melo Avatar asked Aug 16 '15 14:08

Luís Melo


1 Answers

I've fixed this problem by

sudo apt-get install zlib1g-dev
like image 174
Andrii Liubimov Avatar answered Nov 16 '22 19:11

Andrii Liubimov