NameError in WelcomeController#index

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
2 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/bc197399-b461-4a3c-ae6c-40e3b9851a78%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

Walter Lee Davis
What happens when you run the tests in your app? Try these steps:

1. cd into project directory
2. bundle
3. rm db/test.sqlite
4. RAILS_ENV=test rake db:migrate
5. rake

If that last step doesn't cause your tests to start running, try replacing that step with
bundle exec rspec spec

Nota bene: if you try this again later, you only need to re-run step 4 if you have made changes to the database structure with migrations (and none of the previous steps). You should be able to keep trying just step 5 (or the alternate, for rspec, as you make changes to the application to see if the tests pass now.

If the application was made a few years ago, as you said, then it wasn't made in Rails 5.2. How did you get it to that point? Do you have version control to step backwards if necessary for debugging?

If the tests don't run right off the bat, then I would step back in version control to the point where you got the code, and see if they run there. If they do, then you know that something you did while upgrading to 5.2 was the culprit.

If (I hope this is not the case) there aren't any tests at all, then you need to write some before you start updating Rails. Otherwise you are as well off just trying to rewrite the app altogether in the new version of Rails. It's really not a one-step bundle update rails and everything just works. There are a lot of differences between what was current two or three years ago and the just-released Rails 5.2.

Walter

> On Jun 25, 2018, at 3:03 PM, Stephanie_Snowflake <[hidden email]> wrote:
>
> 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 50 def deny_access session[:forward_to] = request.fullpath redirect_to login_url end def check_admin
>
>
> 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/bc197399-b461-4a3c-ae6c-40e3b9851a78%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/91A7B2FE-88AD-4255-9E49-9BD81E15E182%40wdstudio.com.
For more options, visit https://groups.google.com/d/optout.