Pages_controller.rb not in folder


#1

After running the these three lines:
$ rails new MySite
$ bundle install
$ rails server

I tried viewing the Rails App in browser by clicking: http://localhost:8000.
But I get a message "Not Found" in the right side (browser side) of the screen.

Then, in the next step I ran this:
$ rails generate controller Pages

After rails generate finished running, the file pages_controller.rb was NOT created. I could not find it in app/controllers/pages_controller.rb.

Any ideas? I am stuck.

Thanks.


#2

I am also experiencing the same issue. Are we just being stupid?


#3

Same. I'm pretty sure I'm doing it right too...


#4

Hi all,

This isn't your fault, it appears to be a bug in Codecademy's interface. Please try refreshing the page and/or switching browsers, then report it through the form below the instructions on the left.


#5

The rails generate controller Pages command doesn't work for me either. I've tried it on Chrome, Firefox, and Vivaldi. Seems like a bug. I've submitted a bug report with the error code. Cannot progress with the Rails Course thought.


#6

Same here. I've canceled my pro membership due to this, cannot make any progress now so looking for other online courses now.


#7

So how do we solve it and get to the next exercise?


#8

@vallkan There's no reliable easy way that I'm aware of. If you wait, I'm sure the staff will have it fixed soon, though.


#9

I finally figured it out. If you go to #2 and add these into the GEMFILE (code editor)
'tzinfo'
'tzinfo-data'

then bundle install and go to #3

On #3 step 1
refresh the page
do step 1 again and then do step 2 you can then move forward.


#10

what do you mean? where should I add it?
should I add "gem 'tzinfo'" or should I just add 'tzinfo'?


#11

What do you mean go to #2 and #3? None of the steps in the Rails lesson seem to be working. Reading online it seems like it's a version issue, but I tried updating and that didn't help either.


#12

For clarification, because I did not understand what cpumplun was trying to say either, here's another phrasing of the solution.

Before generating the controller (Excercise 3. Controller), navigate to the text file Gemfile. Scroll to the bottom of the document, and paste these two lines of code at the bottom:

gem 'tzinfo'
gem 'tzinfo-data'

Save Gemfile (I had to hit Run instead of save, but it's the same functionally).

Once saved, in the Bash terminal type: bundle install

Finally, Do step 1 of the exercise, which is, in terminal, type: rails generate controller Pages.

You should now have a pages_controller file.

By the way, I had to repeat these steps for the next lesson Broadway to get it to work there too, so might be worth just adding it to the workflow.


Local Host 8000 Not Found Error
Constant errors when following directions
#3: Controllers
‘rails generate controller Pages’ does not work
Error in exercise 4
Unknown error when displaying all messages
3. Controller 3/7: get "/messages" => "messages#index"
4. resources :users
Editor Role I step 1 not working
My first speedbump
Lesson 3 - Controller Routes.rb Syntax Error
I have no idea what's happening with my code
'Circular argument reference - now' error
3. Step 2 - Setting Route
#13

Really thank you. :grin:


#14

Thanks That's Awesome


#15

Thanks for this, I referred to hurstonp 's method to do it bit by bit, but thanks for this original post too :smiley:


#16

BTW You can also use vim in the bash terminal to edit the Gemfile:

$ vim Gemfile

This also works.

Also I'd suggest to specify the version of tzinfo-data like so:

gem 'tzinfo-data', '~> 1.2017', '>= 1.2017.2'

Thanks!


#17

I have followed all the steps that hurstonp suggested, including the addition that al3nmicl identified, but even though the bash indicated that pages_controller was created, I cannot find it in the Controllers folder.


#18

Nevermind! Refreshing the page is always worth the try :smiley:


#19

Actually, I had to edit via the terminal as well as the Gemfile wasn't showing up in the GUI. I used Nano, but same thing. The version info is a good point. Thanks for adding to the solution.


#20

Has this issue really not been addressed by staff after 3 weeks? Should I hold off on a Pro membership?