该系统当前未安装Rails-High Sierra,rbenv

时间:2018-07-22 19:56:47

标签: ruby-on-rails rbenv macos-high-sierra

首先,我遵循Setup Ruby On Rails on macOS 10.13 High Sierra中的确切步骤,就像使用其他版本的mac / ubuntu一样。

因此,基本上安装自制软件,安装rbenv ruby​​-build

在bash配置文件中添加以下内容并获取它:

if which rbenv > /dev/null; then eval "$(rbenv init -)"; fi

然后做

rbenv install 2.5.1
rbenv global 2.5.1
ruby -v

输出:

ruby 2.5.1p57 (2018-03-29 revision 63029) [x86_64-darwin17]

执行which ruby以确保:

/Users/pdavies/.rbenv/shims/ruby

运行gem install

gem install rails -v 5.2.0

输出:

Successfully installed rails-5.2.0
Parsing documentation for rails-5.2.0
Done installing documentation for rails after 0 seconds
1 gem installed

然后重新哈希并检查版本:

rbenv rehash
rails -v

输出:

Rails is not currently installed on this system. To get the latest version, simply type:
$ sudo gem install rails
You can then rerun your "rails" command.

发现了另一个建议添加的花药问题:

export PATH="$HOME/.rbenv/bin:$HOME/.rbenv/shims:$PATH"
eval "$(rbenv init -)"
到bash个人资料,是否找到了它并再次尝试仍然没有任何结果。检查echo $PATH的输出是:

/Users/pdavies/.rbenv/shims:/Users/pdavies/.rbenv/bin:/Users/pdavies/.rbenv/shims:/usr/local/bin:/usr/bin:/usr/sbin:/bin:/sbin

只需确保在没有使用正确的宝石的情况下,我也做了哪个宝石,输出:

/Users/pdavies/.rbenv/shims/gem

当我做一个我会得到的路轨时:

/usr/bin/rails

我找到了一些博客说要删除它,但是我似乎也不能做到这一点,我只是得到了:

sudo rm -f /usr/bin/rails
Password:
rm: /usr/bin/rails: Operation not permitted

这是OSX的全新安装,我可以使它正常工作的唯一方法是降级已安装的OSX的版本,这真是麻烦!

任何帮助将不胜感激

谢谢

0 个答案:

没有答案