RoR - How to remove Rails 4.1.1 version?

前端 未结 2 441

I am new to RoR and I tried to follow the Ruby on Rails Tutorial from Micheal Hartl. Before starting the tutorial I already set up everything earlier and updated the Rails v

相关标签:
2条回答
  • 2021-01-03 07:47

    If you're using bundler (which is highly recommended), you should be able to use different versions of gems for different applications

    --

    Have you tried this:

    In your Gemfile, make sure you have the correct version of Rails referenced -
    gem 'rails', '3.2.0'

    In your app directory - bundle install

    --

    This will use bundler to install the respective gems for your app, which can change as required

    0 讨论(0)
  • 2021-01-03 07:51

    First find the rails gem directory.

    There are many ways to do it, such as looking in your GEM_HOME and GEM_PATH

    echo $GEM_HOME
    echo $GEM_PATH
    

    Here's a brute-force way:

    find / -type d -name rails-4.1.1 
    

    This may find multiple directories, such as the system's gem directory, cache, docs, bundler directory, ruby versioning directories for RVM or chruby, etc.

    If you're the only user of the system, then remove all of these.

    Immediately verify that 4.1.1 is gone:

    # Show the executable, if any
    which rails  
    
    # Show the version, which should not say 4.1.1
    rails --version
    
    # If you're within a bundle directory
    bundle exec rails --version
    

    Do NOT bundle yet.

    Edit your Gemfile, which may also be asking for Rails 4.1.1, and set the exact Rails version that you want:

    gem 'rails', '= 4.0.5'
    

    Now bundle:

    bundle update
    

    Verify that rails 4.1.1 is not in your Gemfile nor lock:

    grep 4.1.1 Gemfile Gemfile.lock
    
    0 讨论(0)
提交回复
热议问题