rail s exiting

39 views
Skip to first unread message

Tak G.

unread,
Aug 27, 2012, 11:08:12 PM8/27/12
to rubyonra...@googlegroups.com
Hello everyone,

I am fairly new to ruby on rails, and I come across this tutorial on
treehouse where they help you make a simple version of facebook.

anyway, I was writing codes, and I came across this error and I am not
sure how to fix it. The error occurs after I type in rail s on the
command prompt and as soon as try to look at how it looks on
127.0.0.1:3000, it gives me this error. the picture is attached since
its a pretty big error.

I checked out config.rb but i wasn't sure what i was looking for.

Attachments:
http://www.ruby-forum.com/attachment/7698/Untitled.png


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

thil

unread,
Aug 27, 2012, 11:22:36 PM8/27/12
to rubyonra...@googlegroups.com
 You need check following things
1. Have you installed all the required gems for your application
     try using 'bundle install' command and try again
2. Check your config->routes.rb any uninitialized controller or action you may added.
3. Check your database connection whether your database exist and credentials are right one in database.yml file.

Thanks,
Senthil


Tak G.

unread,
Aug 28, 2012, 2:17:03 PM8/28/12
to rubyonra...@googlegroups.com
thil wrote in post #1073518:
Thanks for the reply. I have done the first two, and it is still not
working. I am not sure what you mean by checking the database
connection. How do i go about doing that?

Colin Law

unread,
Aug 28, 2012, 3:39:12 PM8/28/12
to rubyonra...@googlegroups.com
Best just to copy and paste errors into here so that we can read and
comment on them more easily.
Can you post your config.ru file please. It seems to be the only bit
of the trace that relates directly to your code.

Colin

Tak G.

unread,
Aug 28, 2012, 3:49:35 PM8/28/12
to rubyonra...@googlegroups.com
Colin Law wrote in post #1073650:
here is the config.ru file and I attached a picture of the error i get.

# This file is used by Rack-based servers to start the application.

require ::File.expand_path('../config/environment', __FILE__)
run StoryTime::Application

Attachments:
http://www.ruby-forum.com/attachment/7701/Untitled.png

Colin Law

unread,
Aug 28, 2012, 4:20:38 PM8/28/12
to rubyonra...@googlegroups.com
I did ask that you copy and paste here, I am suffering from eye strain
trying to read the image and one cannot cursor down it to aid
following it. I don't know whether it will help but can you post
config/environment.rb

Colin

>
>
> --
> Posted via http://www.ruby-forum.com/.
>
> --
> You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
> To post to this group, send email to rubyonra...@googlegroups.com.
> To unsubscribe from this group, send email to rubyonrails-ta...@googlegroups.com.
> For more options, visit https://groups.google.com/groups/opt_out.
>
>

Colin Law

unread,
Aug 28, 2012, 4:28:37 PM8/28/12
to rubyonra...@googlegroups.com
On 28 August 2012 21:20, Colin Law <cla...@googlemail.com> wrote:
> On 28 August 2012 20:49, Tak G. <li...@ruby-forum.com> wrote:
>> Colin Law wrote in post #1073650:
>>> On 28 August 2012 04:08, Tak G. <li...@ruby-forum.com> wrote:
>>>>
>>>> I checked out config.rb but i wasn't sure what i was looking for.
>>>>
>>>> Attachments:
>>>> http://www.ruby-forum.com/attachment/7698/Untitled.png
>>>
>>> Best just to copy and paste errors into here so that we can read and
>>> comment on them more easily.
>>> Can you post your config.ru file please. It seems to be the only bit
>>> of the trace that relates directly to your code.
>>>
>>> Colin
>>
>> here is the config.ru file and I attached a picture of the error i get.
>>
>> # This file is used by Rack-based servers to start the application.
>>
>> require ::File.expand_path('../config/environment', __FILE__)
>> run StoryTime::Application
>>
>> Attachments:
>> http://www.ruby-forum.com/attachment/7701/Untitled.png
>
> I did ask that you copy and paste here, I am suffering from eye strain
> trying to read the image and one cannot cursor down it to aid
> following it. I don't know whether it will help but can you post
> config/environment.rb

Another question, if you make a new app and just do the minimum to get
it to start do you have the same problem?

Colin

Javier Quarite

unread,
Aug 28, 2012, 4:31:21 PM8/28/12
to rubyonra...@googlegroups.com
What I don't get is why the error is in config.ru:5,
because it ends in line 4 with

run StoryTime::Application

maybe the name is Storytime but it depends on how you have done rails new APPNAME

JavierQ

Tak G.

unread,
Aug 28, 2012, 4:40:10 PM8/28/12
to rubyonra...@googlegroups.com
Colin Law wrote in post #1073664:
> On 28 August 2012 20:49, Tak G. <li...@ruby-forum.com> wrote:
>>> Can you post your config.ru file please. It seems to be the only bit
>>
>> Attachments:
>> http://www.ruby-forum.com/attachment/7701/Untitled.png
>
> I did ask that you copy and paste here, I am suffering from eye strain
> trying to read the image and one cannot cursor down it to aid
> following it. I don't know whether it will help but can you post
> config/environment.rb
>
> Colin

config/environment.rb


# Load the rails application
require File.expand_path('../application', __FILE__)

# Initialize the rails application
Storytime::Application.initialize!

I'm not entirely sure how to paste images onto here. I'm a newcomer so.
but the error is pretty much this:

C:\Sites\storytime>rails s
=> Booting WEBrick
=> Rails 3.2.1 application starting in development on
http://0.0.0.0:3000
=> Call with -d to detach
=> Ctrl-C to shutdown server
Exiting
C:/Sites/storytime/config.ru:5:in `block in <main>': uninitialized
constant Stor
yTime (NameError)
from
C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/rack-1.4.1/lib
/rack/builder.rb:51:in `instance_eval'
from
C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/rack-1.4.1/lib
/rack/builder.rb:51:in `initialize'
from C:/Sites/storytime/config.ru:1:in `new'
from C:/Sites/storytime/config.ru:1:in `<main>'
from
C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/rack-1.4.1/lib
/rack/builder.rb:40:in `eval'
from
C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/rack-1.4.1/lib
/rack/builder.rb:40:in `parse_file'
from
C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/rack-1.4.1/lib
/rack/server.rb:200:in `app'
from
C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/railties-3.2.1
/lib/rails/commands/server.rb:46:in `app'
from
C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/rack-1.4.1/lib
/rack/server.rb:301:in `wrapped_app'
from
C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/rack-1.4.1/lib
/rack/server.rb:252:in `start'
from
C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/railties-3.2.1
/lib/rails/commands/server.rb:70:in `start'
from
C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/railties-3.2.1
/lib/rails/commands.rb:55:in `block in <top (required)>'
from
C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/railties-3.2.1
/lib/rails/commands.rb:50:in `tap'
from
C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/railties-3.2.1
/lib/rails/commands.rb:50:in `<top (required)>'
from script/rails:6:in `require'
from script/rails:6:in `<main>'

C:\Sites\storytime>

Colin Law

unread,
Aug 28, 2012, 4:46:41 PM8/28/12
to rubyonra...@googlegroups.com
On 28 August 2012 21:40, Tak G. <li...@ruby-forum.com> wrote:
> Colin Law wrote in post #1073664:
>> On 28 August 2012 20:49, Tak G. <li...@ruby-forum.com> wrote:
>>>> Can you post your config.ru file please. It seems to be the only bit
>>>
>>> Attachments:
>>> http://www.ruby-forum.com/attachment/7701/Untitled.png
>>
>> I did ask that you copy and paste here, I am suffering from eye strain
>> trying to read the image and one cannot cursor down it to aid
>> following it. I don't know whether it will help but can you post
>> config/environment.rb
>>
>> Colin
>
> config/environment.rb
>
>
> # Load the rails application
> require File.expand_path('../application', __FILE__)
>
> # Initialize the rails application
> Storytime::Application.initialize!

There is the clue, notice this is Storytime not StoryTime. Have you
changed some of them manually? Search the whole directory structure
for storytime, case insensitive, and make sure they are all the same.

>
> I'm not entirely sure how to paste images onto here. I'm a newcomer so.
> but the error is pretty much this:

I don't know how you would copy from a terminal in windows. Perhaps
Edit > Copy. In linux you can use Ctrl-Shift-C.

Colin

Tak G.

unread,
Aug 28, 2012, 5:36:08 PM8/28/12
to rubyonra...@googlegroups.com
Colin Law wrote in post #1073669:
> On 28 August 2012 21:40, Tak G. <li...@ruby-forum.com> wrote:
>>> config/environment.rb
>> Storytime::Application.initialize!
> There is the clue, notice this is Storytime not StoryTime. Have you
> changed some of them manually? Search the whole directory structure
> for storytime, case insensitive, and make sure they are all the same.
>
>>
>> I'm not entirely sure how to paste images onto here. I'm a newcomer so.
>> but the error is pretty much this:
>
> I don't know how you would copy from a terminal in windows. Perhaps
> Edit > Copy. In linux you can use Ctrl-Shift-C.
>
> Colin

I honestly haven't changed anything of the sort. it was working find
the other day.

One thing tho, I had to change my motherboard on my laptop, could that
have changed anything?

Colin Law

unread,
Aug 29, 2012, 2:14:48 AM8/29/12
to rubyonra...@googlegroups.com
Are you asking whether changing the mother board could have changed
the text in some of your files on disk?

More importantly you have not said whether, having found and corrected
those that are wrong, does it now work?

I assume you are using a Version Control System such as git. If not
then you should be. Then you can look back through the history to
find when changes were made.

Colin

Tak G.

unread,
Aug 29, 2012, 9:08:35 AM8/29/12
to rubyonra...@googlegroups.com
Colin Law wrote in post #1073724:
> On 28 August 2012 22:36, Tak G. <li...@ruby-forum.com> wrote:
>>>> but the error is pretty much this:
>> have changed anything?
> Are you asking whether changing the mother board could have changed
> the text in some of your files on disk?
>
> More importantly you have not said whether, having found and corrected
> those that are wrong, does it now work?
>
> I assume you are using a Version Control System such as git. If not
> then you should be. Then you can look back through the history to
> find when changes were made.
>
> Colin

Well honestly, it was working before the change of motherboard, and
after it now it doesn't work. I haven't made any changes. It still
doesn't work, I have done everything that everyone has said except for
the one where you try to check your database connection. I don't know
how to check my database connection. And yes I do use git.

Colin Law

unread,
Aug 29, 2012, 9:22:26 AM8/29/12
to rubyonra...@googlegroups.com
So you have searched the directory and looked for all references to
storytime (case insensitive) and made them so they are all StoryTime
(if that is what you want) and not Storytime or anything similar
(which is what you said you had in environment.rb). I am surprised it
ever worked with that. Another critical one will be the module
definition in config/application.rb.

Colin

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

Tak G.

unread,
Aug 29, 2012, 9:37:36 AM8/29/12
to rubyonra...@googlegroups.com
Colin Law wrote in post #1073781:
> On 29 August 2012 14:08, Tak G. <li...@ruby-forum.com> wrote:
>>> I assume you are using a Version Control System such as git. If not
>>> then you should be. Then you can look back through the history to
>>> find when changes were made.
>>>
>>> Colin
>>
>> Well honestly, it was working before the change of motherboard, and
>> after it now it doesn't work. I haven't made any changes. It still
>> doesn't work, I have done everything that everyone has said except for
>> the one where you try to check your database connection. I don't know
>> how to check my database connection. And yes I do use git.
>
> So you have searched the directory and looked for all references to
> storytime (case insensitive) and made them so they are all StoryTime
> (if that is what you want) and not Storytime or anything similar
> (which is what you said you had in environment.rb). I am surprised it
> ever worked with that. Another critical one will be the module
> definition in config/application.rb.
>
> Colin

I mean the only place i know that has storytime is the config.ru Ive
never manually changed the name to all case insensitive either.
changing it to Storytime instead of StoryTime wouldn't let me run rails
s. I looked through all the changes I have made with git status and
looked through the files that I changed but there are not storytime that
i changed.

Colin Law

unread,
Aug 29, 2012, 10:17:27 AM8/29/12
to rubyonra...@googlegroups.com
I don't seem to be getting through here, let us try another tack.
Please copy and paste here the contents of config.ru,
config/environment.rb and config/application.rb

Colin

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

Tak G.

unread,
Aug 29, 2012, 2:23:44 PM8/29/12
to rubyonra...@googlegroups.com
FINALLY got it to work, looks like i missed one of the words. thank you
so much for help.
Reply all
Reply to author
Forward
0 new messages