Pages_controller.rb not in folder


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.



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


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


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.


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.


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


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


@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.


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

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.


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


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.


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

Really thank you. :grin:


Thanks That's Awesome


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


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'



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.


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


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.


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