3

I am fairly new to programming in Ruby on Rails. I am following the instructions on the Rails guide, but I am stuck at the this step $ bin/rails generate controller Welcome index in section 4.2

I have tried running the command spring stop as suggested by Timberlake in this post, but it is still not working, Rails just does not create the files and the route for me as stated in section 4.2

13
  • 4
    What is the output of the command $ bin/rails generate controller Welcome index? Commented Oct 17, 2016 at 21:40
  • what version of rails are you running? Type rails -v in the project directory Commented Oct 17, 2016 at 22:53
  • @StefanLyew, so when I am in the bin directory, I run the command rails generate controller Welcome index, the terminal just prompts me to write the next command without doing anything. Based on the guide, It's supposed to output create app/controllers/welcome_controller.rb route get 'welcome/index' invoke erb create app/views/welcome create app/views/welcome/index.html.erb invoke test_unit create test/controllers/welcome_controller_test.rb invoke helper create app/helpers/welcome_helper.rb.... Commented Oct 18, 2016 at 5:38
  • 1
    you should run this command in project's root directory Commented Oct 18, 2016 at 5:51
  • 1
    @JeffreyYong You can use both of these commands. The second one bin/rails generate only makes sure that the correct rails version your project use gets executed in case there's another 'rails' command in your PATH of different version. Commented Oct 18, 2016 at 6:02

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.