An error occurred while installing the old version of rails: bin_path': Can't Find gem railties (["3.0.5"]) with executable rails (GEM: gemnotfoundexception)

Source: Internet
Author: User

$ Rails _ 3.0.5 _ new depot
Rubygems. RB: 244: In 'bin _ path': Can't Find gem railties (["3.0.5"]) with executable rails (GEM: gemnotfoundexception)
Error
After you reinstall rails sudo gem install rails -- version 3.0.5
$ Rails _ 3.0.5 _ new depot
Dependency. RB: 247: In 'to _ specs': cocould not find rails (= 3.0.5) amongst [bundler-1.6.2, bundler-unload-1.0.2, executable-hooks-1.3.1, GEM-Wrappers-1.2.4, i18n-0.6.9, json-1.8.1, minitest-5.3.3, minitest-1.6.0, rake-0.8.7, rdoc-4.1.1, rdoc-2.5.8, rubygems-bundler-1.4.3, rvm-1.11.3.9, thread_safe-0.3.3] (GEM: loaderror)
From/usr/lib/Ruby/1.9.1/rubygems/dependency. RB: 256: In 'to _ spec'
From/usr/lib/Ruby/1.9.1/rubygems. RB: 1231: In 'G'
From/usr/local/bin/rails: 22: In '<main>'
Run the rvmsudo gem install rails -- version 3.0.5
Warning: Can not check '/etc/sudoers' For 'Secure _ path', falling back to call via '/usr/bin/ENV ', this breaks rules from '/etc/sudoers '. run:

Export rvmsudo_secure_path = 1

To avoid the warning, put it in Shell initialization file to make it persistent.

In case there is no 'Secure _ path' in '/etc/sudoers'. Run:

Export rvmsudo_secure_path = 0

To avoid the warning, put it in Shell initialization file to make it persistent.
Rails's executable "Rails" conflicts with railties
Overwrite the executable? [YN] y
Successfully installed rails-3.0.5
Parsing documentation for rails-3.0.5
Done installing documentation for rails after 0 seconds
1 gem installed

If not, bundle install and run rvmsudo gem install rails -- version 3.0.5 again.
Principle:
An error occurred while installing the path.
I try to explain this a bit because of the upvotes:
This basically is a path issue. if you set up gems via gem install, they mostly likely will be in another directory (e.g. /usr/local/) compared to gems set up via bundler (where you can override it with -- path ). using sudo may also set them up into another directory since sudo starts a subshell which has a different environment then. this is why you have rvmsudo.

If you want to see the differences, compare $ path, $ gem_home, $ gem_path and $ bundle_path when echoing directly, with sudo and with rvmsudo.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.