Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Ruby > Making a Website with Ruby (not rails?)

Reply
Thread Tools

Making a Website with Ruby (not rails?)

 
 
Jesse Jurman
Guest
Posts: n/a
 
      12-09-2010
I have been programming in Ruby for a while and have made several
personal applications, so I'd like to say I'm not a complete novice when
it comes to Ruby, and programming in general; however I have not gone as
far as the complexities involved in Ruby on Rails (it's more or less the
multiple class/files setup).

I want to make a website with Ruby for a group I'm in, nothing
complicated (no forums or accounts), and while this is suppose to be a
simple read-only type website, whenever I look for making websites with
Ruby, I'm always redirected to a Ruby on Rails page. Is this something
that can be done with just Ruby, or would I be better off to learn Ruby
on Rails?

Any tutorials, tips, or links would be greatly appreciated.

-JRJurman

--
Posted via http://www.ruby-forum.com/.

 
Reply With Quote
 
 
 
 
Steve Klabnik
Guest
Posts: n/a
 
      12-09-2010
[Note: parts of this message were removed to make it a legal post.]

Check out Sinatra and/or Camping.

http://www.sinatrarb.com/

http://whywentcamping.com/

 
Reply With Quote
 
 
 
 
Dhruva Sagar
Guest
Posts: n/a
 
      12-09-2010
[Note: parts of this message were removed to make it a legal post.]

+1 for Sinatra, it is damn easy to use and get started with, the source of
sinatra isn't very long either, you can actually read it and understand it
yourself.

--
Thanks & Regards,
Dhruva Sagar.



On Thu, Dec 9, 2010 at 09:56, Steve Klabnik <(E-Mail Removed)> wrote:

> Check out Sinatra and/or Camping.
>
> http://www.sinatrarb.com/
>
> http://whywentcamping.com/
>


 
Reply With Quote
 
Stu
Guest
Posts: n/a
 
      12-09-2010
On Wed, Dec 8, 2010 at 10:23 PM, Jesse Jurman <(E-Mail Removed)> wrote:
> I have been programming in Ruby for a while and have made several
> personal applications, so I'd like to say I'm not a complete novice when
> it comes to Ruby, and programming in general; however I have not gone as
> far as the complexities involved in Ruby on Rails (it's more or less the
> multiple class/files setup).
>
> I want to make a website with Ruby for a group I'm in, nothing
> complicated (no forums or accounts), and while this is suppose to be a
> simple read-only type website, whenever I look for making websites with
> Ruby, I'm always redirected to a Ruby on Rails page. Is this something
> that can be done with just Ruby, or would I be better off to learn Ruby
> on Rails?
>
> Any tutorials, tips, or links would be greatly appreciated.
>
> -JRJurman
>
> --
> Posted via http://www.ruby-forum.com/.
>
>


This one looks interesting:

http://ramaze.net/learn/getting-started

 
Reply With Quote
 
Rainer Frey
Guest
Posts: n/a
 
      12-09-2010
Jesse Jurman wrote:

> I want to make a website with Ruby for a group I'm in, nothing
> complicated (no forums or accounts), and while this is suppose to be a
> simple read-only type website,


What part or aspect of the web site do you want to do in ruby then?

Rainer

 
Reply With Quote
 
Josh Cheek
Guest
Posts: n/a
 
      12-09-2010
[Note: parts of this message were removed to make it a legal post.]

On Wed, Dec 8, 2010 at 10:23 PM, Jesse Jurman <(E-Mail Removed)> wrote:

> I have been programming in Ruby for a while and have made several
> personal applications, so I'd like to say I'm not a complete novice when
> it comes to Ruby, and programming in general; however I have not gone as
> far as the complexities involved in Ruby on Rails (it's more or less the
> multiple class/files setup).
>
> I want to make a website with Ruby for a group I'm in, nothing
> complicated (no forums or accounts), and while this is suppose to be a
> simple read-only type website, whenever I look for making websites with
> Ruby, I'm always redirected to a Ruby on Rails page. Is this something
> that can be done with just Ruby, or would I be better off to learn Ruby
> on Rails?
>
> Any tutorials, tips, or links would be greatly appreciated.
>
> -JRJurman
>
> --
> Posted via http://www.ruby-forum.com/.
>
>

It sounds like you just want a static site (content doesn't change), with
simple pages that you serve up to the user? If so, the simplest way to do it
is just write it with HTML.

-------------------------

A step up from there would be to generate the pages with ERB, this would
allow you to do some calculations in the page at the time you compile them
to HTML. For example:

require 'erb'
template = <<-HTML
<ul>
<% ('a'..'z').each do |char| %>
<li><%= char %></li>
<% end %>
</ul>
HTML
puts ERB.new(template,nil,'>').result

-------------------------

A step up from there would be to go to a static site framework, here is a
pretty good list:
http://ruby-toolbox.com/categories/s...eneration.html

-------------------------

A step up from there would be a simple dynamic website, probably with a
database. I'd suggest Sinatra, and the Sinatra screencast from Peepcode
shows a good example.

-------------------------

And of course, you'll need to host it somewhere. Heroku is fast and easy for
this sort of thing (though you need to know git -- or at least how to add ,
commit , and push) For a static site, you will want this hierarchy:

|-- config.ru
`-- public
|-- file1.html
`-- index.html

Where "public" contains your static html files that you want to serve up,
and "config.ru" has the contents:

run lambda { |env|
if env['PATH_INFO'] == '/'
[301, { 'Location' => '/index.html' , 'Content-Type' => 'text/html' },
[''] ]
else
Rack::File.new(File.dirname(__FILE__)+"/public").call(env)
end
}

-------------------------

Final thoughts: I'm going to recommend against serving Sinatra on Heroku,
you have to know what you're doing and be able to go digging through their
source code to troubleshoot errors stemming from not using Rails. For that,
you might look into Engine Yard, I haven't used them, but they repeatedly
impress me, and are supposed to be willing to work with you if you need it.

If your site is more than trivially dynamic, I think Rails is better than
Sinatra. I worked on a moderately sized Sinatra project where quite a bit of
time was spent dealing with not having the niceties of Rails accessible.

If this is your first dynamic site, and you are debating between Sinatra and
Rails, go with Sinatra. You will be overwhelmed with Rails, but Sinatra is
pretty easy to grok. It also will get you comfortable enough with the
concepts that Rails will be much easier for you afterward.

 
Reply With Quote
 
Mike Stephens
Guest
Posts: n/a
 
      12-09-2010
Horse for courses. Pick something like Joomla, or if the content doesn't
change much, just draw it with something like Xara Web.

--
Posted via http://www.ruby-forum.com/.

 
Reply With Quote
 
Steve Klabnik
Guest
Posts: n/a
 
      12-09-2010
[Note: parts of this message were removed to make it a legal post.]

>
> Final thoughts: I'm going to recommend against serving Sinatra on Heroku,
> you have to know what you're doing and be able to go digging through their
> source code to troubleshoot errors stemming from not using Rails.




Have you tried hosting Sinatra on Heroku? This simply isn't true.

 
Reply With Quote
 
Josh Cheek
Guest
Posts: n/a
 
      12-09-2010
[Note: parts of this message were removed to make it a legal post.]

On Thu, Dec 9, 2010 at 5:47 AM, Steve Klabnik <(E-Mail Removed)>wrote:

> >
> > Final thoughts: I'm going to recommend against serving Sinatra on Heroku,
> > you have to know what you're doing and be able to go digging through

> their
> > source code to troubleshoot errors stemming from not using Rails.

>
>
>
> Have you tried hosting Sinatra on Heroku? This simply isn't true.
>


Yes, I have. I did have to go looking through the Heroku gem maybe 2 or 3
times. It is simple things that you would not think about, like your
database.yaml file must be in a folder named config, in your project root,
and the keys in that file must be strings, not symbols. Whoops, even that
isn't right, it must end in yml, not in yaml. You don't have to think about
that in Rails, Rails just does that, but in not Rails, you need to know.

 
Reply With Quote
 
Steve Klabnik
Guest
Posts: n/a
 
      12-09-2010
[Note: parts of this message were removed to make it a legal post.]

Interesting. I have half a dozen Sinatra projects on Heroku, and I never had
to deal with any of those issues. I guess I just got lucky with my config
setup...

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
#!/usr/bin/ruby , #!/usr/bin/ruby -w , #!/usr/bin/ruby -T?, #!/usr/bin/ruby -T1... anne001 Ruby 1 04-23-2006 03:02 PM
Re: A fresh new approach to making making online Fakename Computer Information 0 11-18-2005 02:10 AM
Making new Flavors : Making a custom transferhandler for and drop applications ebby83@gmail.com Java 5 01-12-2005 11:10 AM
Best program for making thumbnail website from thousands of images? John Digital Photography 3 09-08-2004 12:13 PM
REQ: Help making website Shawn B. ASP .Net 1 12-04-2003 05:35 PM



Advertisments