加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 百科 > 正文

ruby-on-rails – Railties的可执行文件“rails”与/usr/bin/rai

发布时间:2020-12-16 22:16:41 所属栏目:百科 来源:网络整理
导读:我试图安装rails使用命令sudo gem安装rails但是,当我这样做,我得到以下错误消息: railties's executable "rails" conflicts with /usr/bin/rails Overwrite the executable? [yN] 我目前没有安装导轨,我不想安装RVM或rbenv,尽管我稍后可能会这样做. 注: Ra
我试图安装rails使用命令sudo gem安装rails但是,当我这样做,我得到以下错误消息:
railties's executable "rails" conflicts with /usr/bin/rails
 Overwrite the executable? [yN]

我目前没有安装导轨,我不想安装RVM或rbenv,尽管我稍后可能会这样做.

注: Rails当前未安装

有人建议我应该做什么?

谢谢

解决方法

刚刚在我的MacBook上安装Rails时遇到了这个问题.我打开了/usr/bin /目录,并在文本编辑器中打开了“rails”文件.这是结果.
#!/usr/bin/ruby
# Stub rails command to load rails from Gems or print an error if not installed.
require 'rubygems'

version = ">= 0"
if ARGV.first =~ /^_(.*)_$/ and Gem::Version.correct? $1 then
  version = $1
  ARGV.shift
end

begin
  gem 'railties',version or raise
rescue Exception
  puts 'Rails is not currently installed on this system. To get the latest version,simply type:'
  puts
  puts '    $sudo gem install rails'
  puts
  puts 'You can then rerun your "rails" command.'
  exit 0
end

load Gem.bin_path('railties','rails',version)

我认为让gem安装程序重写这个存根是安全的,但现在它更多的是个人喜好.我尽可能避免修改任何“核心”文件.

经过快速的Google搜索,我遇到了这篇有希望的文章,并将其用于我的安装.
Ruby on Rails development setup for Mac OSX

干杯!

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读