Kosmetika
Kosmetika

Reputation: 21314

mac os x 10.9 - brew server requires sinatra error

I want to run brew server on my Mac OS X Mavericks, but it throws an error:

MacBook-Pro-Dmitri:bin dmitri$ brew server
Error: Sinatra required but not found
To install: /usr/bin/gem install sinatra

The problem is that Sinatra is already installed:

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

Then I found that I have two Ruby versions on my machine:

MacBook-Pro-Dmitri:~ dmitri$ cd /Library/Ruby/Gems/
MacBook-Pro-Dmitri:Gems dmitri$ ls -a
.   ..  1.8 2.0.0

And Sinatra is in 2.0.0 folder.. Do I need to switch Ruby versions? Is it possible?

Upvotes: 2

Views: 891

Answers (4)

Ray Hightower
Ray Hightower

Reputation: 11

If you are using RVM, you might consider this procedure.

First, make sure you're using system Ruby, not one of the versions managed by RVM.

$ rvm use system

Verify that system Ruby is the one that you're using

$ rvm current

Check to see whether Sinatra is already installed.

$ gem list sinatra

If Sinatra is already installed with the system gems, then this solution might not work for you. Consider a different approach. However, if Sinatra is not installed, go ahead and install it like so...

$ sudo gem install sinatra

And then test the Homebrew web server.

$ brew server

Navigate your browser to http://localhost:4567 and you should be able to review the list of Homebrew-installed packages from there.

Upvotes: 1

unionx
unionx

Reputation: 437

sudo /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/bin/gem install sinatra

Upvotes: 1

user1904337
user1904337

Reputation:

I realise I might be a bit late, but to anyone else experiencing the same issue: yes, you do need to install it for the system Ruby. Instead of

gem install sinatra

do

/usr/bin/gem install sinatra

You should be able to run brew server after that.

Upvotes: 0

elreimundo
elreimundo

Reputation: 6286

Do you have RVM or another Ruby version control system? https://rvm.io/rvm/install

Upvotes: 0

Related Questions