3

I'm trying to install the following ruby gem on my mac:

http://www.sinatrarb.com/intro.html

I get the following message:

    michael-rosarios-macbook:bin michaelrosario1$ mono ir.exe igem sinatra
    ERROR:  While executing gem ... (RuntimeError)
        Unknown command sinatra
    michael-rosarios-macbook:bin michaelrosario1$ 

Can someone more familiar with Ruby/IronRuby help me out?

Michael Rosario
  • 838
  • 1
  • 11
  • 26

2 Answers2

1

It appears that I had missed an argument installing sinatra:

michael-rosarios-macbook:bin michaelrosario1$ mono ir.exe igem install sinatra
Successfully installed rack-1.0.0
Successfully installed sinatra-0.9.4
2 gems installed
Installing ri documentation for rack-1.0.0...
Installing ri documentation for sinatra-0.9.4...
Installing RDoc documentation for rack-1.0.0...
Installing RDoc documentation for sinatra-0.9.4...

I'm now experiencing issues with writing a "hello world" example using Sinatra. This is probably related to Shay's comment. Any other thoughts!?

Michael Rosario
  • 838
  • 1
  • 11
  • 26
  • If this answer is the "correct" one (it seems to be) - as in, it solved your problem, accept it when you can. – Lucas Jones Aug 02 '09 at 11:52
  • 1
    Hi there are special mono builds available that have all the necessary launcher scripts (provided you put the bin in your path). That would allow you to type igem install sinatra. http://ironruby.colliertech.org/ – Casual Jim Aug 04 '09 at 08:21
0

First thing - I'm not familiar with mono, but on Windows I would execute "igem sinatra" without ir before that. Maybe that's the problem?

Anyways, if you're having troubles installing the gem using igem, try MRI gem installer instead. After that you'll be able to use it via IronRuby with a tiny tweak.

On your ruby file add the next line: $LOAD_PATH << path_to_mri_gems_folder where path_to_mri_gems_folder would be the full path to the MRI gems folder. After this line require sinatra.

There is also a patch of the IronRuby team for Sinatra, I'm not sure if it's still needed: http://www.ironruby.net/Documentation/Real_Ruby_Applications/Sinatra

Shay.

Shay Friedman
  • 4,808
  • 5
  • 35
  • 51