我试图安装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
干杯!