NameError in WelcomeController#index

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
12 messages Options
Reply | Threaded
Open this post in threaded view
|

NameError in WelcomeController#index

Stephanie_Snowflake

Steps to reproduce

cd [app directory]
rails server
open localhost:3000/welcome/index

(Guidelines for creating a bug report are available
here
)

Expected behavior

I should be able to see the login screen for our ROR App (pcms.herokuapps.com)

Actual behavior

45 46 47 48 49 50def deny_access session[:forward_to] = request.fullpath redirect_to login_url end def check_admin

enter image description here

How to I get to the ROR app. Like it looks like the live site.

https://pcms.herokuapp.com/login

The app was designed by a previous developer in 2013. I just received the files two weeks ago. Having to update everything to latest versions of everything. I've added the database into the pgAdmin4.

I need to be able to see the changes in the localhost before pushing to heroku platform.

routes.rb

YES I am in the App Directory

System configuration

Rails version:
Rails 5.2.0
Ruby version:
ruby 2.5.1p57 (2018-03-29 revision 63029) [x86_64-darwin17]

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/c49fe5c0-f3e7-4af5-b644-ef2e6667b170%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: NameError in WelcomeController#index

Stephanie_Snowflake


On Monday, June 25, 2018 at 2:02:44 PM UTC-5, Stephanie_Snowflake wrote:

Steps to reproduce


USING POSTGRESQL 
 

cd [app directory]
rails server
open localhost:3000/welcome/index

(Guidelines for creating a bug report are <a href="http://edgeguides.rubyonrails.org/contributing_to_ruby_on_rails.html#creating-a-bug-report" rel="nofollow" style="background-color:transparent;color:rgb(3,102,214)" target="_blank" onmousedown="this.href=&#39;http://www.google.com/url?q\x3dhttp%3A%2F%2Fedgeguides.rubyonrails.org%2Fcontributing_to_ruby_on_rails.html%23creating-a-bug-report\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNHNu8ACTbcyZ23q1pWVWCu712zDmA&#39;;return true;" onclick="this.href=&#39;http://www.google.com/url?q\x3dhttp%3A%2F%2Fedgeguides.rubyonrails.org%2Fcontributing_to_ruby_on_rails.html%23creating-a-bug-report\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNHNu8ACTbcyZ23q1pWVWCu712zDmA&#39;;return true;">available
here)

Expected behavior

I should be able to see the login screen for our ROR App (<a href="http://pcms.herokuapps.com" target="_blank" rel="nofollow" onmousedown="this.href=&#39;http://www.google.com/url?q\x3dhttp%3A%2F%2Fpcms.herokuapps.com\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNFnUtksJEBAOaAO1L42ntQ6RAoJPQ&#39;;return true;" onclick="this.href=&#39;http://www.google.com/url?q\x3dhttp%3A%2F%2Fpcms.herokuapps.com\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNFnUtksJEBAOaAO1L42ntQ6RAoJPQ&#39;;return true;">pcms.herokuapps.com)

Actual behavior

45 46 47 48 49 50def deny_access session[:forward_to] = request.fullpath redirect_to login_url end def check_admin

<a href="https://i.stack.imgur.com/wzPUI.jpg" rel="nofollow" style="background-color:transparent;color:rgb(3,102,214)" target="_blank" onmousedown="this.href=&#39;https://www.google.com/url?q\x3dhttps%3A%2F%2Fi.stack.imgur.com%2FwzPUI.jpg\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNH-Il9NbktaEd2msmXcR10EgJ676A&#39;;return true;" onclick="this.href=&#39;https://www.google.com/url?q\x3dhttps%3A%2F%2Fi.stack.imgur.com%2FwzPUI.jpg\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNH-Il9NbktaEd2msmXcR10EgJ676A&#39;;return true;">enter image description here

How to I get to the ROR app. Like it looks like the live site.

<a href="https://pcms.herokuapp.com/login" rel="nofollow" style="background-color:transparent;color:rgb(3,102,214)" target="_blank" onmousedown="this.href=&#39;https://www.google.com/url?q\x3dhttps%3A%2F%2Fpcms.herokuapp.com%2Flogin\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNEaCfSsF1WfD7TABSiKvZ0XOBQNvA&#39;;return true;" onclick="this.href=&#39;https://www.google.com/url?q\x3dhttps%3A%2F%2Fpcms.herokuapp.com%2Flogin\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNEaCfSsF1WfD7TABSiKvZ0XOBQNvA&#39;;return true;">https://pcms.herokuapp.com/login

The app was designed by a previous developer in 2013. I just received the files two weeks ago. Having to update everything to latest versions of everything. I've added the database into the pgAdmin4.

I need to be able to see the changes in the localhost before pushing to heroku platform.

routes.rb

YES I am in the App Directory

System configuration

Rails version:
Rails 5.2.0
Ruby version:
ruby 2.5.1p57 (2018-03-29 revision 63029) [x86_64-darwin17]

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/2664047b-b2d3-4c1b-bef2-36b0c10dc125%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: NameError in WelcomeController#index

Hassan Schroeder-2
In reply to this post by Stephanie_Snowflake
On Mon, Jun 25, 2018 at 11:59 AM, Stephanie_Snowflake
<[hidden email]> wrote:

> The app was designed by a previous developer in 2013. I just received the
> files two weeks ago. Having to update everything to latest versions of
> everything. I've added the database into the pgAdmin4.
>
> I need to be able to see the changes in the localhost before pushing to
> heroku platform.

1) Did it run locally with the original versions of "everything"?
2) Did the tests all pass originally?
3) Do the tests pass now?
4) Are there errors in the console when you start the app?

--
Hassan Schroeder ------------------------ [hidden email]
twitter: @hassan
Consulting Availability : Silicon Valley or remote

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/CACmC4yAEp_hmJgqhjENmADhS-PdcT5WGMQmGW%2Bbj5sfFjFNFhQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: NameError in WelcomeController#index

Stephanie_Snowflake
Yes the original version ran fine. No errors. Just had to updated rails, ruby, gems, etc since the app is still running on the original version, and the platform asked us to update several things. 

On Monday, June 25, 2018 at 3:06:43 PM UTC-5, Hassan Schroeder wrote:
On Mon, Jun 25, 2018 at 11:59 AM, Stephanie_Snowflake
<<a href="javascript:" target="_blank" gdf-obfuscated-mailto="5lKdoYXlBwAJ" rel="nofollow" onmousedown="this.href=&#39;javascript:&#39;;return true;" onclick="this.href=&#39;javascript:&#39;;return true;">spicyc...@...> wrote:

> The app was designed by a previous developer in 2013. I just received the
> files two weeks ago. Having to update everything to latest versions of
> everything. I've added the database into the pgAdmin4.
>
> I need to be able to see the changes in the localhost before pushing to
> heroku platform.

1) Did it run locally with the original versions of "everything"?
2) Did the tests all pass originally?
3) Do the tests pass now?
4) Are there errors in the console when you start the app?

--
Hassan Schroeder ------------------------ <a href="javascript:" target="_blank" gdf-obfuscated-mailto="5lKdoYXlBwAJ" rel="nofollow" onmousedown="this.href=&#39;javascript:&#39;;return true;" onclick="this.href=&#39;javascript:&#39;;return true;">hassan.s...@...
twitter: @hassan
Consulting Availability : Silicon Valley or remote

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/d6595e8d-e483-4c85-8083-9f7909b43eb6%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: NameError in WelcomeController#index

Colin Law
On 25 June 2018 at 21:12, Stephanie_Snowflake <[hidden email]> wrote:
> Yes the original version ran fine. No errors. Just had to updated rails,
> ruby, gems, etc since the app is still running on the original version, and
> the platform asked us to update several things.

You have answered question 1 but not 2, 3 or 4.

Colin

>
> On Monday, June 25, 2018 at 3:06:43 PM UTC-5, Hassan Schroeder wrote:
>>
>> On Mon, Jun 25, 2018 at 11:59 AM, Stephanie_Snowflake
>> <[hidden email]> wrote:
>>
>> > The app was designed by a previous developer in 2013. I just received
>> > the
>> > files two weeks ago. Having to update everything to latest versions of
>> > everything. I've added the database into the pgAdmin4.
>> >
>> > I need to be able to see the changes in the localhost before pushing to
>> > heroku platform.
>>
>> 1) Did it run locally with the original versions of "everything"?
>> 2) Did the tests all pass originally?
>> 3) Do the tests pass now?
>> 4) Are there errors in the console when you start the app?
>>
>> --
>> Hassan Schroeder ------------------------ [hidden email]
>> twitter: @hassan
>> Consulting Availability : Silicon Valley or remote
>
> --
> You received this message because you are subscribed to the Google Groups
> "Ruby on Rails: Talk" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [hidden email].
> To post to this group, send email to [hidden email].
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/rubyonrails-talk/d6595e8d-e483-4c85-8083-9f7909b43eb6%40googlegroups.com.
>
> For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/CAL%3D0gLu5ot9nRwH-uxERCrNYmp%3DpgA5ErtKvsy_u8rwXfwxWBw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: NameError in WelcomeController#index

Hassan Schroeder-2
In reply to this post by Stephanie_Snowflake
On Mon, Jun 25, 2018 at 1:12 PM, Stephanie_Snowflake
<[hidden email]> wrote:
> Yes the original version ran fine. No errors. Just had to updated rails,
> ruby, gems, etc since the app is still running on the original version, and
> the platform asked us to update several things.

That answered *1* question...

>> 1) Did it run locally with the original versions of "everything"?
>> 2) Did the tests all pass originally?
>> 3) Do the tests pass now?
>> 4) Are there errors in the console when you start the app?

--
Hassan Schroeder ------------------------ [hidden email]
twitter: @hassan
Consulting Availability : Silicon Valley or remote

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/CACmC4yAmSACjYSo51BMBDZEp1r5RTe-CyjZ6qJVxXXyGztFDLA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: NameError in WelcomeController#index

Stephanie_Snowflake
Yes ran locally with the original versions of everything. Yes all the test passed. 

Currently the only error is on the Welcome Controller. 

No errors in the console

On Monday, June 25, 2018 at 3:18:05 PM UTC-5, Hassan Schroeder wrote:
On Mon, Jun 25, 2018 at 1:12 PM, Stephanie_Snowflake
<<a href="javascript:" target="_blank" gdf-obfuscated-mailto="C1M8ViTmBwAJ" rel="nofollow" onmousedown="this.href=&#39;javascript:&#39;;return true;" onclick="this.href=&#39;javascript:&#39;;return true;">spicyc...@...> wrote:
> Yes the original version ran fine. No errors. Just had to updated rails,
> ruby, gems, etc since the app is still running on the original version, and
> the platform asked us to update several things.

That answered *1* question...

>> 1) Did it run locally with the original versions of "everything"?
>> 2) Did the tests all pass originally?
>> 3) Do the tests pass now?
>> 4) Are there errors in the console when you start the app?

--
Hassan Schroeder ------------------------ <a href="javascript:" target="_blank" gdf-obfuscated-mailto="C1M8ViTmBwAJ" rel="nofollow" onmousedown="this.href=&#39;javascript:&#39;;return true;" onclick="this.href=&#39;javascript:&#39;;return true;">hassan.s...@...
twitter: @hassan
Consulting Availability : Silicon Valley or remote

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/4f142542-afc1-413c-8336-6cbc19d3ed59%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: NameError in WelcomeController#index

Hassan Schroeder-2
On Mon, Jun 25, 2018 at 1:24 PM, Stephanie_Snowflake
<[hidden email]> wrote:
> Yes ran locally with the original versions of everything. Yes all the test
> passed.
>
> Currently the only error is on the Welcome Controller.
>
> No errors in the console

If there's a problem I'd expect it in the console or in the development
log file.

Where is this "error" you're seeing? Can you paste it in here?

--
Hassan Schroeder ------------------------ [hidden email]
twitter: @hassan
Consulting Availability : Silicon Valley or remote

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/CACmC4yAAhM%3DEmRP9tq5udtV9rsoQs%3DL1cYUrLZEiowUju%2By3Ow%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: NameError in WelcomeController#index

Stephanie_Snowflake
ERROR

localhost:3000/welcome/index

NameError in WelcomeController#index

undefined local variable or method `login_url' for #<WelcomeController:0x00007fa9da705068>

Extracted source (around line #47):
45
46
47
48
49
50
              
def deny_access
session[:forward_to] = request.fullpath
redirect_to login_url
end
def check_admin

Rails.root: /Users/snowflake/Documents/Current Website/pcms


On Monday, June 25, 2018 at 3:30:19 PM UTC-5, Hassan Schroeder wrote:
On Mon, Jun 25, 2018 at 1:24 PM, Stephanie_Snowflake
<<a href="javascript:" target="_blank" gdf-obfuscated-mailto="DoIIYs_mBwAJ" rel="nofollow" onmousedown="this.href=&#39;javascript:&#39;;return true;" onclick="this.href=&#39;javascript:&#39;;return true;">spicyc...@...> wrote:
> Yes ran locally with the original versions of everything. Yes all the test
> passed.
>
> Currently the only error is on the Welcome Controller.
>
> No errors in the console

If there's a problem I'd expect it in the console or in the development
log file.

Where is this "error" you're seeing? Can you paste it in here?

--
Hassan Schroeder ------------------------ <a href="javascript:" target="_blank" gdf-obfuscated-mailto="DoIIYs_mBwAJ" rel="nofollow" onmousedown="this.href=&#39;javascript:&#39;;return true;" onclick="this.href=&#39;javascript:&#39;;return true;">hassan.s...@...
twitter: @hassan
Consulting Availability : Silicon Valley or remote

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/ce21d0e8-7baf-43a2-99cd-d3e67d504031%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: NameError in WelcomeController#index

Hassan Schroeder-2
On Mon, Jun 25, 2018 at 1:34 PM, Stephanie_Snowflake
<[hidden email]> wrote:

> undefined local variable or method `login_url' for
> #<WelcomeController:0x00007fa9da705068>

So does 'login' show up when you run `rake routes`? How are you
authenticating?

--
Hassan Schroeder ------------------------ [hidden email]
twitter: @hassan
Consulting Availability : Silicon Valley or remote

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/CACmC4yAVN-S%2BYs30v%3DFHi%2BK1xHuo6c6uLq7458S%2BrjX7u-REDw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: NameError in WelcomeController#index

Stephanie_Snowflake
$rails routes

WARNING: Nokogiri was built against LibXML version 2.9.4, but has dynamically loaded 2.8.0
** Invoke routes (first_time)
** Invoke environment (first_time)
** Execute environment
** Execute routes
                   Prefix Verb URI Pattern                                                                              Controller#Action
            welcome_index GET  /welcome/index(.:format)                                                                 welcome#index
       rails_service_blob GET  /rails/active_storage/blobs/:signed_id/*filename(.:format)                               active_storage/blobs#show
rails_blob_representation GET  /rails/active_storage/representations/:signed_blob_id/:variation_key/*filename(.:format) active_storage/representations#show
       rails_disk_service GET  /rails/active_storage/disk/:encoded_key/*filename(.:format)                              active_storage/disk#show
update_rails_disk_service PUT  /rails/active_storage/disk/:encoded_token(.:format)                                      active_storage/disk#update
     rails_direct_uploads POST /rails/active_storage/direct_uploads(.:format)

On Monday, June 25, 2018 at 3:40:26 PM UTC-5, Hassan Schroeder wrote:
On Mon, Jun 25, 2018 at 1:34 PM, Stephanie_Snowflake
<<a href="javascript:" target="_blank" gdf-obfuscated-mailto="VTrLgFznBwAJ" rel="nofollow" onmousedown="this.href=&#39;javascript:&#39;;return true;" onclick="this.href=&#39;javascript:&#39;;return true;">spicyc...@...> wrote:

> undefined local variable or method `login_url' for
> #<WelcomeController:0x00007fa9da705068>

So does 'login' show up when you run `rake routes`? How are you
authenticating?

--
Hassan Schroeder ------------------------ <a href="javascript:" target="_blank" gdf-obfuscated-mailto="VTrLgFznBwAJ" rel="nofollow" onmousedown="this.href=&#39;javascript:&#39;;return true;" onclick="this.href=&#39;javascript:&#39;;return true;">hassan.s...@...
twitter: @hassan
Consulting Availability : Silicon Valley or remote

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/5d1734e9-7d35-4a6e-a89c-aacb717c6d95%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: NameError in WelcomeController#index

Stephanie_Snowflake
Rails.application.routes.draw do
     get 'welcome/index'

  resources :feedbacks, only: [:post]

On Monday, June 25, 2018 at 3:42:32 PM UTC-5, Stephanie_Snowflake wrote:
$rails routes

WARNING: Nokogiri was built against LibXML version 2.9.4, but has dynamically loaded 2.8.0
** Invoke routes (first_time)
** Invoke environment (first_time)
** Execute environment
** Execute routes
                   Prefix Verb URI Pattern                                                                              Controller#Action
            welcome_index GET  /welcome/index(.:format)                                                                 welcome#index
       rails_service_blob GET  /rails/active_storage/blobs/:signed_id/*filename(.:format)                               active_storage/blobs#show
rails_blob_representation GET  /rails/active_storage/representations/:signed_blob_id/:variation_key/*filename(.:format) active_storage/representations#show
       rails_disk_service GET  /rails/active_storage/disk/:encoded_key/*filename(.:format)                              active_storage/disk#show
update_rails_disk_service PUT  /rails/active_storage/disk/:encoded_token(.:format)                                      active_storage/disk#update
     rails_direct_uploads POST /rails/active_storage/direct_uploads(.:format)

On Monday, June 25, 2018 at 3:40:26 PM UTC-5, Hassan Schroeder wrote:
On Mon, Jun 25, 2018 at 1:34 PM, Stephanie_Snowflake
<[hidden email]> wrote:

> undefined local variable or method `login_url' for
> #<WelcomeController:0x00007fa9da705068>

So does 'login' show up when you run `rake routes`? How are you
authenticating?

--
Hassan Schroeder ------------------------ [hidden email]
twitter: @hassan
Consulting Availability : Silicon Valley or remote

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/5890e71a-a7ab-45dc-9c94-5ba6fbc3b2fc%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.