Forum: Ruby on Rails Need help for simple RoR code.

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
Mark S. (Guest)
on 2006-02-24 00:03
I try a 'hello world' demo here,It only show a 'hello word' on web page

you can see all my codes and structure here

http://www.smtservers.com/demo/

I want to access the ruby app like this

http://www.smtservers.com/demo/say/hello

but I get a 404 error.

Please let me know what problem the code have

I am new for RoR. I am not sure the site structure is ok or not.

Please give me a help

Thanks

Mark
Mark S. (Guest)
on 2006-02-24 00:31
who have a working 'hello world' demo.Please send it to me by zip file.I
can upload to the server to test.it is RoR hosting,but why my code can
not work there.

my email removed_email_address@domain.invalid

Thanks a lot

Mark

mark sheran wrote:
> I try a 'hello world' demo here,It only show a 'hello word' on web page
>
> you can see all my codes and structure here
>
> http://www.smtservers.com/demo/
>
> I want to access the ruby app like this
>
> http://www.smtservers.com/demo/say/hello
>
> but I get a 404 error.
>
> Please let me know what problem the code have
>
> I am new for RoR. I am not sure the site structure is ok or not.
>
> Please give me a help
>
> Thanks
>
> Mark
Eric G. (Guest)
on 2006-02-24 00:38
(Received via mailing list)
Hi Mark,
The first problem is your server is pointed to the wrong directory. It
should be pointed to the public directory in your rails app.
After that you need to set up a "demo" controller and then and action
called "say". ex. #ruby script/generate controller demo index say
Cheers,
Eric G.

mark sheran wrote:
> mark sheran wrote:
>>
>> Mark
>>
>
>
>


--
Eric G.
http://www.ericgoodwin.com
Mark S. (Guest)
on 2006-02-24 00:53
Based on my idea,Demo is a folder,say is a application and hello is a
action.
This is a hosting company,I can not access httpd.conf,how to fix this?

Thanks

Eric G. wrote:
> Hi Mark,
> The first problem is your server is pointed to the wrong directory. It
> should be pointed to the public directory in your rails app.
> After that you need to set up a "demo" controller and then and action
> called "say". ex. #ruby script/generate controller demo index say
> Cheers,
> Eric G.
>
> mark sheran wrote:
>> mark sheran wrote:
>>>
>>> Mark
>>>
>>
>>
>>
>
>
> --
> Eric G.
> http://www.ericgoodwin.com
Eric G. (Guest)
on 2006-02-24 01:02
(Received via mailing list)
Hi Mark,
Who are you hosting with. On Dreamhost you should be able to go to "
Remap a new sub-directory" and map a dir to a certain folder in your
home dir.
On Textdrive you can go to webmin and then apache webserver, your
virtual webserver, alias and redirect and put an alias from /demo to
/home/youraccount/demo/railsapp/public
Cheers,
Eric G.

mark sheran wrote:
>> should be pointed to the public directory in your rails app.
>>>>
>>>>
>>>
>>>
>> --
>> Eric G.
>> http://www.ericgoodwin.com
>>
>
>
>


--
Eric G.
http://www.ericgoodwin.com
Mark S. (Guest)
on 2006-02-24 01:13
I can access the server by telnet.do you think I can do this.but I can
not access Apache settings.

which file I have to change?

Thanks

Mark
Eric G. wrote:
> Hi Mark,
> Who are you hosting with. On Dreamhost you should be able to go to "
> Remap a new sub-directory" and map a dir to a certain folder in your
> home dir.
> On Textdrive you can go to webmin and then apache webserver, your
> virtual webserver, alias and redirect and put an alias from /demo to
> /home/youraccount/demo/railsapp/public
> Cheers,
> Eric G.
>
> mark sheran wrote:
>>> should be pointed to the public directory in your rails app.
>>>>>
>>>>>
>>>>
>>>>
>>> --
>>> Eric G.
>>> http://www.ericgoodwin.com
>>>
>>
>>
>>
>
>
> --
> Eric G.
> http://www.ericgoodwin.com
Eric G. (Guest)
on 2006-02-24 01:39
(Received via mailing list)
Hi,
If you can't access your webserver settings then I don't know how you
would do this.
I would talk with your host and get them to set it up for you.
Cheers,
Eric G.

mark sheran wrote:
>> Hi Mark,
>>
>>>> http://www.ericgoodwin.com
>
--
Eric G.
http://www.ericgoodwin.com
Mark S. (Guest)
on 2006-02-24 01:42
Do you mean they have to set this again for different RoR application?

Thanks

Mark
Eric G. wrote:
> Hi,
> If you can't access your webserver settings then I don't know how you
> would do this.
> I would talk with your host and get them to set it up for you.
> Cheers,
> Eric G.
>
> mark sheran wrote:
>>> Hi Mark,
>>>
>>>>> http://www.ericgoodwin.com
>>
> --
> Eric G.
> http://www.ericgoodwin.com
Nicolai R. (Guest)
on 2006-02-24 01:45
(Received via mailing list)
How about contacting your hosting provider. It's their job.
Mark S. (Guest)
on 2006-02-24 01:52
Who can make sure my 'hello word' code is correct?I am very new for
RoR.Thanks.

Mark
Nicolai Reuschling wrote:
> How about contacting your hosting provider. It's their job.
Ben M. (Guest)
on 2006-02-24 06:38
(Received via mailing list)
Mark, you can't just put a rails app in a web-accesible directory and
expect apache to
know what to do with it. It requires (some would say rather complicated)
configuration
changes to apache.

And why are you trying to deal with the whole issue of connecting a
rails app to apache
and how things will work with your hosting company and all of that
*before* you've even
learned the merest basics about rails and ruby?

Take that app you generated and -- on YOUR computer -- run "ruby
script\server" from the
command line within the app root. That will start the included webrick
server on port
3000. Then you can get to your "hello world" page at
http://localhost:3000/say/hello.

I gave you links to a couple tutorials last week, but it's apparent that
you haven't truly
digested what they said. You should read them again, thoroughly... and
you should probably
order the Agile Web D. with Rails book and follow through the
sample app they
build in the first section of the book.

Rails is getting a lot of buzz because it does a lot of nice things for
developers and has
a lot of cool features. But that doesn't mean it's dead simple to use.
There is plenty to
learn (just look at the volume of questions on this list). Give yourself
the time to learn!

b
NexusNeo - Niket P. (Guest)
on 2006-02-24 12:11
(Received via mailing list)
http://www.smtservers.com/demo/public/say/hello/

check above link. your app is works fine

now if u have ssh access try following commands
after login to your account

mv public_html/demo ~/
cd public_html
ln -s ~/demo/public demo

now you can access your app like

http://www.smtservers.com/demo/say/hello/

On 2/24/06, mark sheran <removed_email_address@domain.invalid> wrote:
> Posted via http://www.ruby-forum.com/.
> _______________________________________________
> Rails mailing list
> removed_email_address@domain.invalid
> http://lists.rubyonrails.org/mailman/listinfo/rails
>



--
Best Regards,
Niket P.
For NexusNeo Exim
(A Div of NexusNeo System & Exim Pvt. Ltd)
Tel:  +91 79 23244557
Fax: +91 79 23246531
E-mail: removed_email_address@domain.invalid
Web:   www.nexusneo.com
This topic is locked and can not be replied to.