我想在我的MacOSX小牛上运行brew server
,但它抛出了一个错误:
MacBook-Pro-Dmitri:bin dmitri$ brew server
Error: Sinatra required but not found
To install: /usr/bin/gem install sinatra
问题是sinatra已经安装:
MacBook-Pro-Dmitri:gems dmitri$ ls -a
. CFPropertyList-2.2.4 mini_portile-0.5.2 rack-1.5.2 rubygems-update-2.1.11 sqlite3-1.3.8
.. libxml-ruby-2.7.0 nokogiri-1.6.0 rack-protection-1.5.1 sinatra-1.4.4 tilt-1.4.1
然后我发现我的机器上有两个Ruby版本:
MacBook-Pro-Dmitri:~ dmitri$ cd /Library/Ruby/Gems/
MacBook-Pro-Dmitri:Gems dmitri$ ls -a
. .. 1.8 2.0.0
Sinatra在
2.0.0
文件夹里我需要切换Ruby版本吗有可能吗? 最佳答案
sudo /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/bin/gem install sinatra