Ruby 1.9.2 and Rails 3 cannot open rails console

前端 未结 10 1994
野性不改
野性不改 2020-12-01 06:04
[gkaykck@main myApplication]$ rails console
/usr/local/lib/ruby/1.9.1/irb/completion.rb:9:in `require\': no such file to load -- readline (LoadError)
    from /usr/l         


        
10条回答
  •  星月不相逢
    2020-12-01 06:54

    First of all uninstall every ruby version you have.

    After that display rvm requirements:

    rvm requirements
    

    You will get something like:

    Requirements for Linux ( DISTRIB_ID=Ubuntu
    DISTRIB_RELEASE=11.10
    DISTRIB_CODENAME=oneiric
    DISTRIB_DESCRIPTION="Ubuntu 11.10" )
    
    NOTE: 'ruby' represents Matz's Ruby Interpreter (MRI) (1.8.X, 1.9.X)   
    This is the *original* / standard Ruby Language Interpreter  
          'ree'  represents Ruby Enterprise Edition  
          'rbx'  represents Rubinius  
    
    bash >= 4.1 required curl is required git is required (>= 1.7 for
    ruby-head) patch is required (for 1.8 rubies and some ruby-head's).
    
    To install rbx and/or Ruby 1.9 head (MRI) (eg. 1.9.2-head), then you
    must install and use rvm 1.8.7 first.
    
    Additional Dependencies: 
    # For Ruby / Ruby HEAD (MRI, Rubinius, & REE), install the following:
      ruby: /usr/bin/apt-get install build-essential openssl libreadline6 
      libreadline6-dev curl git-core zlib1g zlib1g-dev libssl-dev libyaml-dev 
      libsqlite3-0 libsqlite3-dev sqlite3 libxml2-dev libxslt-dev autoconf libc6-dev 
      ncurses-dev automake libtool bison subversion
    
    # For JRuby, install the following:
      jruby: /usr/bin/apt-get install curl g++ openjdk-6-jre-headless
      jruby-head: /usr/bin/apt-get install ant openjdk-6-jdk
    
    # For IronRuby, install the following:
      ironruby: /usr/bin/apt-get install curl mono-2.0-devel
    

    Install all dependencies via apt-get.
    After that install ruby 1.8.7. This version is required if you plan to use ruby 1.9.x
    Now you can install ruby 1.9.3:

    rvm pkg install readline
    rvm remove 1.9.3
    rvm install 1.9.3 --with-readline-dir=$rvm_path/usr
    

    Note that you dont even need to install readline package via rvm if you had installed it using apt-get.

提交回复
热议问题