X
XY$
Hi
I wonder if it is possible to run Sinatra without useing RubyGems.
Thanks
K
I wonder if it is possible to run Sinatra without useing RubyGems.
Thanks
K
XY$ said:I wonder if it is possible to run Sinatra without useing RubyGems.
XY$ said:I wonder if it is possible to run Sinatra without useing RubyGems.
Depends on what you mean. For my purposes, the answer is yes.
I use gem for package management, but crown[1] to construct a
self-contained set of lib, ext, and bin dirs so that my program can run
without any reference to rubygems.
The following command builds the self-contained dirs that contain
everything I need for what I do with sinatra:
$ crown -v mydir sequel nokogiri sinatra json thin pg
All those gems are now available as ordinary libraries under mydir/.
There's no chance that a gem update will break your code. You can check
in the gem stuff alongside your project code so that you have a snapshot
of exactly what libs you were using at that version.
Running crown will also output something like:
PATH=/home/username/project/somedir/bin
RUBYLIB=/home/username/project/somedir/ext/json/ext:/home/username/project/somedir/lib:/home/username/project/somedir/ext
You can paste this into your main app file so that it knows where to
find the libs. Also, you can remove RUBYOPT='-rubygems' from your env.
[1]http://github.com/vjoel/crown
XY$ said:I wonder if it is possible to run Sinatra without useing RubyGems.
Depends on what you mean. For my purposes, the answer is yes.
I use gem for package management, but crown[1] to construct a
OK
I was not precise in my question.
The web hosting service I am testing supports Ruby but not RoR or
RubyGems. I can run Ruby scripts as CGI but I wonder if I would be
able to use Sinatra.
I hope and pray you mean FastCGI, or FCGI, because CGI will be painfullyOKDepends on what you mean. For my purposes, the answer is yes.XY$ said:I wonder if it is possible to run Sinatra without useing RubyGems.
I use gem for package management, but crown[1] to construct a
self-contained set of lib, ext, and bin dirs so that my program can run
without any reference to rubygems.
The following command builds the self-contained dirs that contain
everything I need for what I do with sinatra:
$ crown -v mydir sequel nokogiri sinatra json thin pg
All those gems are now available as ordinary libraries under mydir/.
There's no chance that a gem update will break your code. You can check
in the gem stuff alongside your project code so that you have a snapshot
of exactly what libs you were using at that version.
Running crown will also output something like:
PATH=/home/username/project/somedir/bin
RUBYLIB=/home/username/project/somedir/ext/json/ext:/home/username/project/somedir/lib:/home/username/project/somedir/ext
You can paste this into your main app file so that it knows where to
find the libs. Also, you can remove RUBYOPT='-rubygems' from your env.
[1]http://github.com/vjoel/crown
I was not precise in my question.
The web hosting service I am testing supports Ruby but not RoR or
RubyGems. I can run Ruby scripts as CGI but I wonder if I would be
able to use Sinatra.
Thanks
XY$ said:I wonder if it is possible to run Sinatra without useing RubyGems.
Depends on what you mean. For my purposes, the answer is yes.
I use gem for package management, but crown[1] to construct a
self-contained set of lib, ext, and bin dirs so that my program can run
without any reference to rubygems.
Jonathan said:XY$ said:I wonder if it is possible to run Sinatra without useing RubyGems.
Depends on what you mean. For my purposes, the answer is yes.
I use gem for package management, but crown[1] to construct a
self-contained set of lib, ext, and bin dirs so that my program can
run without any reference to rubygems.
Impressive! What do you see as the benefits of crown over nkryptic's
sandbox:
http://github.com/nkryptic/sandbox
I'm trying to make up my mind which approach should be used in different
situations.
Want to reply to this thread or ask your own question?
You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.