RoR - How to remove Rails version 4.1.1?

I am new to RoR and I tried to follow Micheal Hartl's Ruby on Rails tutorial. Before starting the tutorial, I already configured everything earlier and upgraded Rails to 4.1.1, and everything worked fine until the tutorial, where I needed to have the maximum version of Rails version 4.0.5, to continue this example. For this, I tried several things. First I run:

gem uninstall rails

after which I received a message stating that it was deleted, but when I ran rails -v, I still had 4.1.1. Then, after one answer on stackoverflow, to remove railties, I did:

gem uninstall railties 4.1.1

then at startup: rails -v I received a message about starting version 3.2.18, which was the one I installed as part of railsinstaller. Unfortunately, after creating a new application, he settled on installing the package and did not continue several times. Then I tried to remove all the gems to install everything from scratch. I did this with:

ruby -e " gem list.split (/ $ /). each {| line | puts gem uninstall -Iax #{line.split(' ')[0]}if line.strip.empty?}"

which I also found here. He removed the gems, after which I deleted Ruby. Then I installed everything again using railsinstaller with Rails version 3.2.18. When he finished and when I opened cmd, in the Rails Environment configuration in the Rails version, I was able to see version 4.1.1 again. When I ran:

gem uninstall rails

3.2.18, . , , ​​ , 4.1.1 , . , , , -, 4.0.5. railties rails 4.1.1, : "4.0.5".

, , . , , , , . , 4.1.1, . , - , forevr. !

+4
2

gem.

, , GEM_HOME GEM_PATH

echo $GEM_HOME
echo $GEM_PATH

:

find / -type d -name rails-4.1.1 

, , , , bundler, RVM chruby ..

, .

, 4.1.1:

# 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

.

Gemfile, Rails 4.1.1, Rails:

gem 'rails', '= 4.0.5'

:

bundle update

, 4.1.1 Gemfile :

grep 4.1.1 Gemfile Gemfile.lock
+2

bundler ( ),

-

:

Gemfile , Rails -
gem 'rails', '3.2.0'

- bundle install

-

bundler ,

0

Source: https://habr.com/ru/post/1541191/


All Articles