How to put a Ruby website online without rails

  • Thread starter Softmind Technology
  • Start date
S

Softmind Technology

Hi,

I would like to develop a website totally in Ruby.

But i do not want to go the MVC way. Neither i want to go Ruby on Rails
way.

I have heard many stories about rails deployment. Its no as easy as PHP
deployment, neither are good host available for Ruby on rails.

what is the next option.....? I think Rails can't be the only solution.

I would like to place my website online just like PHP, but using Ruby
instead of PHP.

The platform would be Apache and MySql.

I think Ruby and Dreamweaver can make a nice combination. I also have
Netbeans and Scite installed and both works great.

I think preparing the design in Dreamweaver and checking the codes in
Netbeans, would be a nice idea.... But how to implement this ...?

Thanks

SoftMind
 
M

Marcin Raczkowski

there is mod_ruby just like mod_php.

there was lots of ruby applications before rails - but MVC was found to
be best way to handle web development :)

anyway if you want just use mod_ruby - or cgi or fast-cgi.

choice is yours.

greets
 
V

Vasyl Smirnov

You may want to try FastCGI, specifically, fcgi library for Ruby (gem
install fcgi)
and mod_fcgid for Apache.

You don't want to touch mod_ruby if you want to save your sleep.
 
M

Matt Todd

If what you want is PHP-like, why don't you use PHP? You certainly
sound more attuned to the PHP style of web development as it is.

Why do something half-assed with one language what you can do probably
better in another language that has much more support for that style
of development, etc. You won't find as much documentation for Ruby web
development not employing MVC paradigms... it's almost a de-facto
standard of Ruby web development (not to say that it is the ultimate
(tm) way to developm, but that it is the preferred way).

Don't try to struggle and do something awkward, just go with the
natural choice for the job.

If you do want to learn Ruby, consider that the reason why Ruby is
preferable to the likes of PHP is because of good style, flexibility,
and good libraries and tools doing the heavy lifting for us with some
standards.

Deploying on servers isn't impossible, it's just not the same as
Apache. There's plenty of documentation and suggestions where to get
it done and how, so it's not going to be difficult to do.

Rails is a lot to learn and it's certainly not small, but there are
other options. Merb is in the same area with Rails with regards to
being bigger than smaller, but it's very clean, light weight, and
shouldn't be too different from Rails. There are other frameworks like
Ramaze, Sinatra, IOWA, etc.

I would highly recommend you reconsider your decision to not go with
an MVC approach and also reconsider the facts.

Matt
 
H

hux0r

I would like to place my website online just like PHP, but using Ruby
instead of PHP.

The platform would be Apache and MySql.

I had a very nice experience with ERUBY. Eruby was easy to install on a
shared host and easy to configure since they had CPanel.

It should take your average admin 2.7 secs to install in case your server
host will do that for you.

Mod_ruby, erb and fastcgi are all valid alternatives, too.

Casimir
 
G

Giles Bowkett

Rails is a lot to learn and it's certainly not small, but there are
other options. Merb is in the same area with Rails with regards to
being bigger than smaller, but it's very clean, light weight, and
shouldn't be too different from Rails. There are other frameworks like
Ramaze, Sinatra, IOWA, etc.

Just wanted to highlight this bit. Also Camping, Nitro, and probably
others I've forgotten.

--
Giles Bowkett

Podcast: http://hollywoodgrit.blogspot.com
Blog: http://gilesbowkett.blogspot.com
Portfolio: http://www.gilesgoatboy.org
Tumblelog: http://giles.tumblr.com
 
J

John Joyce

as far as the language you choose, it all depends on what you want to
do and how much you want to do.
If you just need some simple, quick things, PHP might be a better
choice to get started and make things work.
If you are interested in more complex things, you will want to use
some existing framework in any language to help things be structured
and easier to maintain and add to.
The problem is, without experiencing several frameworks in several
languages, it is difficult to compare them or even choose the right
one for a particular project.
The web hosting provider you use, and features you get for the paid
service level will determine some things for you.
All frameworks and languages will have a learning curve.

But again, if you just need some little things here and there, PHP
might be the best approach in the beginning, since many of it's
functions are quick, one-trick-ponies, and PHP is widely supported
and easy to get started with for web development.
But if you need a lot of features, spend some time investigating a
language/framework combination that will work for you.
It all depends on the specifics.
If you need to do a lot of sophisticated things, you might find PHP
quickly becomes tedious to work with. Then look into Ruby or Python
based frameworks that save you a lot of work in the long-run.

Generally speaking, web sites are not set-it-and-forget-it, they
often require regular updates and changes.
 
J

James Dinkel

I have wondered this same thing. Sometimes a web framework isn't the
best option, but I know Ruby very well and I don't know PHP at all.
What would I have to do that I can just create a file called somepage.rb
with this in it:

<html>
<body>
<p>This is counting to 10: <%= 10.times { |n| print n+1, " " } %></p>
</body>
</html>

And just have to dump it into any old folder that Apache servers pages
in and have it served properly? Can I just do "sudo aptitude -y install
mod_ruby" and will it Just Work(tm)?
 
P

Paul Stickney

I have wondered this same thing. Sometimes a web framework isn't the
best option, but I know Ruby very well and I don't know PHP at all.
What would I have to do that I can just create a file called somepage.rb
with this in it:

And the good news is ... FRAMEWORKS DON'T HAVE TO EAT YOUR SOUL! :)

RoR is the *Most Popular* web framework for Ruby.
It is *not* the only framework. Some others are:

Nitro/Og http://www.nitroproject.org/

Camping http://redhanded.hobix.com/bits/campingAMicroframework.html

Ramaze http://ramaze.net/

Sinatra http://sinatra.rubyforge.org/

Merb http://merbivore.com/

NARF http://www.narf-lib.org/

Etc (I'm sure there are many more)

I would recommend looking around and seeing if any one of the dozens
of current frameworks would work for you. They aren't all huge. They
aren't all slow. They don't all have the same (or any) notion of MVC.

In the end I would avoid using PHP at all costs (unless dictated due
to server resources or monetary pay) because I hate that wretched
language. And, I would look at a framework which offers--it doesn't
need to mandate--an MVC architecture or other method of separating
HTML and code. Even if you don't [want to] use it now, having the
option may allow for a cleaner transition....
 
S

Softmind Technology

Hello All,

Let me come out clear. I do not know PHP, neither i am a Php guy.

I am just like James Dinkel, who has explained his requirement above.

I am totally into plain Ruby. Not even rails.

I am looking for a solution where i can place the codes inline the HTML
file just like classic asp and Php.

Currently Rails is placing the codes inside HTML with ERB. I want to
place the codes same way either with include file or some other way...
But... Without Ruby on rails.

It would be better, if some one can point me out a working tutorial or
blog based on my requirement. I do not want to get tied up initially
with any of MVC.

Hope i have cleared myself.

Thanks

SoftMind.
 
M

Marcin Raczkowski

Softmind said:
Hello All,

Let me come out clear. I do not know PHP, neither i am a Php guy.

I am just like James Dinkel, who has explained his requirement above.

I am totally into plain Ruby. Not even rails.

I am looking for a solution where i can place the codes inline the HTML
file just like classic asp and Php.

Currently Rails is placing the codes inside HTML with ERB. I want to
place the codes same way either with include file or some other way...
But... Without Ruby on rails.

It would be better, if some one can point me out a working tutorial or
blog based on my requirement. I do not want to get tied up initially
with any of MVC.

Hope i have cleared myself.

Thanks

SoftMind.

You can just use Erubis + Ruby + Apache with mod_fcgi or Mongrel
 
S

Softmind Technology

Marcin said:
You can just use Erubis + Ruby + Apache with mod_fcgi or Mongrel
--------------------------------------------------------------------
@Marcin,

Can you point me a blog/tutorial etc for a start.

I do not know how to implement such things. I do not know what is
Erubis.

Your help would be appreciated.

P.S.:- if any one has implemented such things... Pl. come out and help
us too.

Thanks

SoftMind
 
M

Marcin Raczkowski

You have technology in name, you should be able to read technical
documentation right?

erubis is rhtml template technology -
http://www.kuwata-lab.com/erubis/users-guide.html

fast cgi -
https://rubyforge.org/projects/fcgi/

took me 2 google queries and 5-6 clicks, what so hard about it?
if you are not profficient with ruby - go use rails - mvc is not really
stupid idea.

if you are not you can hire me as consutant and I'll write you php style
framework in 2hours and charge you 400$

go figure
 
T

thefed

Hello All,

Let me come out clear. I do not know PHP, neither i am a Php guy.

I am just like James Dinkel, who has explained his requirement above.

I am totally into plain Ruby. Not even rails.

I am looking for a solution where i can place the codes inline the
HTML
file just like classic asp and Php.

Currently Rails is placing the codes inside HTML with ERB. I want to
place the codes same way either with include file or some other way...
But... Without Ruby on rails.

It would be better, if some one can point me out a working tutorial or
blog based on my requirement. I do not want to get tied up initially
with any of MVC.

I know EXACTLY what you're looking for :)

These are all engines to create STATIC sites - no knowledge of
anything required

* nanoc - http://nanoc.stoneship.org/
Awesome tool for creating static websites - just the pages and ruby,
nothing else :)
* staticmatic - http://staticmatic.rubyforge.org/
Ruby + Haml + Sass
* hobix - http://hobix.com/
suitable replacement for hallucinogens
* webby - http://webby.rubyforge.org/
redcloth as markup

Personally, I enjoy nanoc and staticmatic. There are still more
listed in the nanoc manual http://nanoc.stoneship.org/help/manual/
chapter-1/#similar-projects

HTH,
Ari Brown
 
J

Jeremy McAnally

Just FYI, I released a framework called Vintage last night that's
based on the original idea of Merb: Erb templates with Mongrel (though
I've expanded that concept to allow for more template renderers). No
MVC, no big infrastructure: just clean, simple templating that can be
used for simple or complex pages. I'm going to port it to Rack soon
so you can use some deployment setups that are a little simpler than
Mongrel, but if you're not scared of a little setup (proxying,
Mongrel, pretty easy) then give it a spin.

Source is here: http://vintage.devjavu.com/

More documentation coming soon.

--Jeremy

Hi,

I would like to develop a website totally in Ruby.

But i do not want to go the MVC way. Neither i want to go Ruby on Rails
way.

I have heard many stories about rails deployment. Its no as easy as PHP
deployment, neither are good host available for Ruby on rails.

what is the next option.....? I think Rails can't be the only solution.

I would like to place my website online just like PHP, but using Ruby
instead of PHP.

The platform would be Apache and MySql.

I think Ruby and Dreamweaver can make a nice combination. I also have
Netbeans and Scite installed and both works great.

I think preparing the design in Dreamweaver and checking the codes in
Netbeans, would be a nice idea.... But how to implement this ...?

Thanks

SoftMind



--
http://www.jeremymcanally.com/

My books:
Ruby in Practice
http://www.manning.com/mcanally/

My free Ruby e-book
http://www.humblelittlerubybook.com/

My blogs:
http://www.mrneighborly.com/
http://www.rubyinpractice.com/
 
Y

yudi

[Note: parts of this message were removed to make it a legal post.]

Ramaze looks good, gotta take a look. Thanks :)
 
J

James Dinkel

Here is a forum post that tells you how to embed ruby script into
webpages just like php does. This uses mod_ruby and eruby. It's
basically just apt install a couple packages and then add some Apache
configuration.

http://ubuntuforums.org/showthread.php?t=356350

Read all the way through it as I think the configuration in the last
post is the best version. But I have not tried this myself yet, but it
looks like it is all legit and nothing stupid or extraneous is being
done.

This is not much different than mod_php. Really, the only difference is
that the mod_php install takes care of the apache configuration for you.
I just wish that the mod_ruby installation did the same thing. Just
install mod_ruby and the apache configuration would be taken care of.
Really all it would need is one file added to the deb installation
package. But for the time being, I guess at least it is possible to do.
 
M

Michal Suchanek

Here is a forum post that tells you how to embed ruby script into
webpages just like php does. This uses mod_ruby and eruby. It's
basically just apt install a couple packages and then add some Apache
configuration.

http://ubuntuforums.org/showthread.php?t=356350

Read all the way through it as I think the configuration in the last
post is the best version. But I have not tried this myself yet, but it
looks like it is all legit and nothing stupid or extraneous is being
done.

This is not much different than mod_php. Really, the only difference is
that the mod_php install takes care of the apache configuration for you.
I just wish that the mod_ruby installation did the same thing. Just
install mod_ruby and the apache configuration would be taken care of.
Really all it would need is one file added to the deb installation
package. But for the time being, I guess at least it is possible to do.

I suggest you stay away from mod_ruby because it is not as clean as it
should. The 1.8 interpreter cannot be reset, and as Apache reuses
processes some stuff may leak from one script into another. Using with
the multithreaded Apache also won't be a big win as multiple Ruby
threads cannot run concurrently. You probably can't even create
multiple threads running ruby safely (as opposed to creating multiple
ruby threads inside one native thread of execution as is done in the
interpreter). You can use ruby as cgi scripts or with Mongrel or
something but mod_ruby is not the right way.

Thanks

Michal
 
M

Michael Granger

I suggest you stay away from mod_ruby because it is not as clean as it
should. The 1.8 interpreter cannot be reset, and as Apache reuses
processes some stuff may leak from one script into another.

This statement is completely fallacious. If you exercise just the
minimum of programming discipline, you can easily write mod_ruby
applications that run for months without any appreciable leakage. You
certainly must take precautions against using global variables and
poorly-namespaced classes, and mod_ruby is probably not suitable for
running in an untrusted or shared environment without additional
partitioning, but that doesn't describe the majority of situations.

I've been running several mod_ruby applications for a year and a half
where I work that require restarts only for new code or bugfixes.
They've gotten over 3 million dynamic hits since they were first
deployed, which isn't exactly as much of a stress-test as some other
sites, but enough to demonstrate the error in your generalizations.
Using with
the multithreaded Apache also won't be a big win as multiple Ruby
threads cannot run concurrently.

In addition to being specious, this means nothing in the context of
your point.
You probably can't even create
multiple threads running ruby safely (as opposed to creating multiple
ruby threads inside one native thread of execution as is done in the
interpreter).


Please, if you must post advice against using a particular piece of
software, please provide concrete evidence of its unsuitability.
Conjecture is mildly interesting in some situations, but when you
impugn someone else's hard work you should at least have the courtesy
to give examples, hard facts, or at the very least stick to points
which you don't have to qualify with "probably".

I'd be happy to provide further details if anyone's interested. I'm
just getting tired of the FUD and hastily-posted conjecture about what
constitutes appropriate technology for building web applications.
 

Ask a Question

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.

Ask a Question

Members online

Forum statistics

Threads
473,755
Messages
2,569,535
Members
45,007
Latest member
obedient dusk

Latest Threads

Top