Sinatra and Shotgun Gems

Hi all,

I’m working of playing around with a Nettuts Sinatra tutorial:

and for whatever reason, I can’t get the shotgun gem to load. My
terminal (Debian Linux) returns the following:

mint@mint ~/Test-Run $ shotgun basics.rb
No command ‘shotgun’ found, did you mean:
Command ‘shogun’ from package ‘shogun-cmdline’ (universe)
shotgun: command not found
mint@mint ~/Test-Run $

I have tried editing my gem paths, but that shouldn’t be it since
sinatra works, right?

Any help would be appreciated.

Thanks,
Ryan

This worked for me on Ubuntu after “sudo gem install shotgun”
$ shotgun hello.rb
== Shotgun/WEBrick on http://127.0.0.1:9393/
[2011-04-01 09:51:16] INFO WEBrick 1.3.1
[2011-04-01 09:51:16] INFO ruby 1.9.2 (2010-08-18) [x86_64-linux]
[2011-04-01 09:51:16] INFO WEBrick::HTTPServer#start: pid=3310
port=9393
127.0.0.1 - - [01/Apr/2011 09:52:30] “GET / HTTP/1.1” 200 12 0.0030

Prasad

2011/4/1 Ryan C. [email protected]

Ryan C. wrote in post #990276:

I have tried editing my gem paths, but that shouldn’t be it since
sinatra works, right?

How did you install sinatra? You might be using the native Debian
package rather than the gem:

$ apt-cache search sinatra
libsinatra-ruby - Ruby web-development dressed in a DSL (Ruby 1.8
package)
libsinatra-ruby-doc - Ruby web-development dressed in a DSL
(documentation)
libsinatra-ruby1.8 - Ruby web-development dressed in a DSL
libsinatra-ruby1.9.1 - Ruby web-development dressed in a DSL

in which case the gems dir may not in fact be on your search path.

I suggest you try the following:

export PATH=/var/lib/gems/1.8/bin:$PATH
shotgun …blah blah…

Brian,

That was the fix I was looking for! Thank you.

One more question: Will I need to enter this path command every time I
rebook Linux? I’ve read a little on having a .bashrc file, but haven’t
attempted to create anything… I might need a little help if the case
is that I will need one.

Thanks,
Ryan