CAn't get ruby to work
Posted by: Lubricus
Posted on: 2008-02-24 11:35:00
I can't get anything to work here beta.valkeriagames.net/hello2.cgi I can't get it to show. please help
Posted by: Lubricus
Posted on: 2008-02-24 11:35:00
I can't get anything to work here beta.valkeriagames.net/hello2.cgi I can't get it to show. please help
Posted by: rlparker
Posted on: 2008-02-24 11:54:00
In reply to:I can't get anything to work here beta.valkeriagames.net/hello2.cgi I can't get it to show. please help
How are we supposed to help you with a post like that? ![]()
--rlparker
Posted by: Lubricus
Posted on: 2008-02-24 12:13:00
I'm sorry I just keep getting 500 internal server errors I setup rails and everything and fastcgi so I have no idea why its not working.
Posted by: rlparker
Posted on: 2008-02-24 12:20:00
A good place to start would be to inspect your error logs to see what additional clues they might provide as to the source of your problems(s)
You can find your logs within the "logs" directory of your user space when you log in via the shell or connect via ftp.
There are a *lot* of things that could go wrong when you "setup rails and everything and fastcgi", so you have to start somewhere, and your logs are as good a place as any! ![]()
--rlparker
Posted by: Lubricus
Posted on: 2008-02-24 12:30:00
I don't understand the errors all they are is
[Sun Feb 24 12:26:35 2008] [error] [client 24.131.209.78] Premature end of script headers: hello1.cgi
and
[Sun Feb 24 11:51:19 2008] [error] [client 69.234.114.112] Premature end of script headers: hello2.cgi
I can't understand all I'm trying to do is
for hello1.cgi the code is
#!/usr/bin/ruby
# hello1.cgi
puts "Content-Type: text/html"
puts
puts "<html>"
puts "<body>"
puts "<h1>Hello Ruby!</h1>"
puts "</body>"
puts "</html>"
and for hello2.cgi
:: #!/usr/bin/ruby
:: # hello2.cgi
::
:: require 'cgi'
::
:: # Create a cgi object, with HTML 4 generation methods.
:: cgi = CGI.new(''html4'')
::
:: # Ask the cgi object to send some text out to the browser.
:: cgi.out {
:: cgi.html {
:: cgi.body {
:: cgi.h1 { ''Hello Ruby!'' }
:: }
:: }
:: }
Posted by: rlparker
Posted on: 2008-02-24 12:49:00
In reply to:Premature end of script headers: hello1.cgi ... Premature end of script headers: hello2.cgi
This can very likely mean there is a problem with the format of your hello1.cgi and hello2.cgi files. Did you produce these files with a *nix editor, and are you *sure* they have *nix style" line endings?
Secondly did you upload them to your space in ASCII mode?
I assume you have them set to executable permissions also, right?
I just took your hello1.cgi code from your post, placed it onto a DH server (I created the file with nano from within the shell), set it's permissions to 755, and it runs fine! ![]()
http://maddogz.com/ruby/hello1.cgi
--rlparker
Posted by: Lubricus
Posted on: 2008-02-24 12:59:00
Still doesn't work
and I tried to upload them in ASCII and I chmod it to 755
I'm using gVim and I have no idea what you mean by unix style line endings.
Posted by: rlparker
Posted on: 2008-02-24 13:14:00
In reply to:Still doesn't work ... and I tried to upload them in ASCII and I chmod it to 755 ... I'm using gVim and I have no idea what you mean by unix style line endings.
Well, then something is "not right" with your setup or your file. I suggest before you start using rails and fastcgi, you first make sure you can run hello1.cgi from a "stock" DreamHost account.
Until you can do that, you will only complicate matters considerably by trying to run fastcgi and rails.
This should give you all you need to know about "*nix style line endings" , though gVim *should* be giving you those by default.
--rlparker
Posted by: Lubricus
Posted on: 2008-02-24 13:26:00
I'm trying it in nano but how do I save in nano and what is a stock account
Posted by: rlparker
Posted on: 2008-02-24 13:34:00
In reply to:I'm trying it in nano but how do I save in nano and what is a stock account
There are many different ways to "save" in nano, and a full help manual for nano is available - man nano.
Also, within nano, just type <ctrl-g> for "instant help" - there is a menu at the bottom of the screen. ![]()
By a "stock" account, I mean your DreamHost account as it was when you signed up (without any fastcgi/rails related "tweaking").
--rlparker
Posted by: Lubricus
Posted on: 2008-02-24 14:02:00
Ok there was actually a problem with the files of rails so I reinstalled it but I have no idea what I do in database.yml
where I put all the info please help
# SQLite version 3.x
# gem install sqlite3-ruby (not necessary on OS X Leopard)
development:
adapter: sqlite3
database: db/development.sqlite3
timeout: 5000
# Warning: The database defined as 'test' will be erased and
# re-generated from your development database when you run 'rake'.
# Do not set this db to the same as development or production.
test:
adapter: sqlite3
database: db/test.sqlite3
timeout: 5000
production:
adapter: sqlite3
database: db/production.sqlite3
timeout: 5000
Posted by: rlparker
Posted on: 2008-02-24 14:30:00
That's another whole subject, and should really be a new thread. ![]()
In reply to:I have no idea what I do in database.yml
where I put all the info please help
You ought to read that first link I gave you one more time.
Just like *nix line endings, and the use of nano, there is a lot of information about what to "do in database.yml" to be found on the web with a little google grease (just search and read). I don't mind helping you, but you probably should do some of the research on this stuff yourself and make an effort to understand what you are trying to do before asking others to "walk you through" each step.
I'm sure that, once you have done some studying and some research on your own, if you open a new thread about your database.yml problem with a specific question, there are those here who will help you further. Good Luck!
--rlparker