Page 1 of 2 12 LastLast
Results 1 to 10 of 19

Thread: Can't install Ruby on Rails

  1. #1
    Join Date
    May 2010
    Beans
    24

    Can't install Ruby on Rails

    To day, I installed Ruby on Rails
    Here is the step : ;
    1. Dowload Ruby source code and install it
    ( Ruby 1.9.1-p376 (md5: ebb20550a11e7f1a2fbd6fdec2a3e0a3) from http://www.ruby- lang.org/en/downloads/

    $ ./configure; make; sudo make install
    Here is the result :
    Code:
        nxhoaf@NeverGiveUp:/usr/local/bin$ ruby -v
        ruby 1.9.1p376 (2009-12-07 revision 26041) [i686-linux]
    2. Dowload Ruby gem and install it (rubygems-1.3.7.tgz from http://rubyforge.org /frs/?group_id=126)
    nxhoaf@NeverGiveUp:~/Downloads/rubygems-1.3.7$ ruby setup.rb
    ..............
    RubyGems installed the following executables:
    /usr/local/bin/gem
    and the result :
    Code:
      nxhoaf@NeverGiveUp:/usr/local/bin$ gem -v
       1.3.7
    3. But when i try to execute the folowing command, an error occured :
    Code:
     nxhoaf@NeverGiveUp:/usr/local/bin$ sudo gem install rails --include-dependenciesERROR:  Loading command: install (LoadError)
        no such file to load -- zlib
    ERROR:  While executing gem ... (NameError)
        uninitialized constant Gem::Commands::InstallCommand
    nxhoaf@NeverGiveUp:/usr/local/bin$
    and when i tried to update gem, it seem not to work
    Code:
    nxhoaf@NeverGiveUp:/usr/local/bin$ sudo gem update
    ERROR:  Loading command: update (LoadError)
        no such file to load -- zlib
    ERROR:  While executing gem ... (NameError)
        uninitialized constant Gem::Commands::UpdateCommand
    nxhoaf@NeverGiveUp:/usr/local/bin$
    I didn't know why i got that error
    anyone can help me !!!!!!
    Last edited by nxhoaf; April 3rd, 2012 at 12:12 PM.

  2. #2
    Join Date
    Oct 2004
    Location
    USA
    Beans
    330
    Distro
    Ubuntu 14.04 Trusty Tahr

    Re: Can't install Ruby on Rails

    Is there a specific reason you are installing ruby and rubygems from source? It looks like almost everything you need is available via the repositories as long as you have a relatively recent version of Ubuntu.

    See this page for more information: https://help.ubuntu.com/community/RubyOnRails.

    Otherwise, I am not sure about that error.
    XBL Status: Xbox Live friend notifications for Linux

  3. #3
    Join Date
    May 2010
    Beans
    24

    Re: Can't install Ruby on Rails

    I followed it and it still not working . Btw, can anyone tell me how to create a ruby on rails project on netbeans. I read this tutor but in the migration database step, it doesn't work, too (
    http://netbeans.org/kb/docs/ruby/rapid-ruby-weblog.html

  4. #4
    Join Date
    Mar 2007
    Beans
    2

    Re: Can't install Ruby on Rails

    Hey all!, same problem

    Code:
    me@mypc:~$ ruby -v
    ruby 1.9.2p0 (2010-08-18 revision 29036) [i686-linux]
    me@mypc:~$ gem -v
    1.3.7
    then I try:

    Code:
    me@mypc:~$ gem install rails
    ERROR:  Loading command: install (LoadError)
        no such file to load -- zlib
    ERROR:  While executing gem ... (NameError)
        uninitialized constant Gem::Commands::InstallCommand


    I've installed zlib* from apt-get, but it doesn't help.
    Thanks in advance for your help!.

  5. #5
    Join Date
    Oct 2007
    Beans
    74

    Re: Can't install Ruby on Rails

    To the original poster: Rails is not compatible with ruby 1.9.1, you have to use 1.9.2 or 1.8.7.

    Try installing libzlib-ruby from apt-get.

    If that doesn't work, then install with rvm which is the preferred way to install ruby. They even have a section that addresses the zlib problem.

  6. #6
    Join Date
    Oct 2010
    Beans
    1

    Re: Can't install Ruby on Rails

    Quote Originally Posted by b1nar10 View Post
    Hey all!, same problem

    Code:
    me@mypc:~$ ruby -v
    ruby 1.9.2p0 (2010-08-18 revision 29036) [i686-linux]
    me@mypc:~$ gem -v
    1.3.7
    then I try:

    Code:
    me@mypc:~$ gem install rails
    ERROR:  Loading command: install (LoadError)
        no such file to load -- zlib
    ERROR:  While executing gem ... (NameError)
        uninitialized constant Gem::Commands::InstallCommand


    I've installed zlib* from apt-get, but it doesn't help.
    Thanks in advance for your help!.
    Hi,

    I had the exact problem. So i thought i'd leave a note on how i managed to finally fix this.

    Even you install zlib after installing ruby via RVM, things do not work well. And yes you get that ' no such file to load -- zlib' error when you use the 'gem' command. e.g. 'gem list'

    So here's what I did
    - First remove your rvm ruby installation:
    rvm remove ruby-x.x.x # put your ruby version here

    - T
    hen install zlib via rvm
    rvm package install zlib

    - Finally install ruby again
    rvm install ruby-x.x.x

    --Fixed! --

    All the credit goes to 'JasonOng' response below:
    http://stackoverflow.com/questions/2...1-9-1-troubles

    'JasonOng' mentioned that you better use :
    rvm install 1.9.1 -C --with-zlib-dir=$rvm_path/usr

    ..but i didn't have use the '-C --with..' part

    Anyway this problem did not occur when I followed this great tute which tells you to install zlib and the other required packages before using rvm to install ruby:
    http://rbjl.net/19-rubybuntu-1-insta...ails-on-ubuntu

    Hope this helps to anyone searching for a fix.

  7. #7
    Join Date
    Jun 2008
    Location
    Moscow, Russia
    Beans
    1
    Distro
    Ubuntu 10.10 Maverick Meerkat

    Re: Can't install Ruby on Rails

    Quote Originally Posted by nxhoaf View Post
    and when i tried to update gem, it seem not to work
    Code:
    nxhoaf@NeverGiveUp:/usr/local/bin$ sudo gem update
    ERROR:  Loading command: update (LoadError)
        no such file to load -- zlib
    ERROR:  While executing gem ... (NameError)
        uninitialized constant Gem::Commands::UpdateCommand
    nxhoaf@NeverGiveUp:/usr/local/bin$
    I didn't know why i got that error
    anyone can help me !!!!!!

    PS : sorry for my english
    Before you install Ruby, you need to install some libraries:

    Code:
    sudo aptitude install build-essential libssl-dev libreadline5 libreadline5-dev zlib1g zlib1g-dev

  8. #8
    Join Date
    Jun 2006
    Beans
    596
    Distro
    Kubuntu

    Re: Can't install Ruby on Rails

    Quote Originally Posted by MMCX View Post
    installing ruby via RVM
    Don't use RVM.
    http://www.lucas-nussbaum.net/blog/?p=550

    brezenix has the right idea.

  9. #9
    Join Date
    Feb 2011
    Beans
    1

    Re: Can't install Ruby on Rails

    This is probably obvious to most people, but it tripped me up: when brezenix says you need to install those libraries before installing ruby, he means you need to install them before compiling ruby. Being new to linux, it took me a few minutes to realize that.

  10. #10
    Join Date
    Jun 2007
    Location
    Tampa, FL USA
    Beans
    6
    Distro
    Ubuntu 8.04 Hardy Heron

    Re: Can't install Ruby on Rails

    Hey guys, this is easier to resolve than you think. Basically, if the zlib library isn't there at the time you compile ruby, you just have to go back and install the library and then re-compile that module. Here are the steps:

    Code:
    sudo apt-get install zlib1g-dev
    cd /ruby-source-files/ext/zlib
    ruby extconf.rb
    make
    sudo make install
    Now you have zlib enabled

Page 1 of 2 12 LastLast

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •