I am new to ruby and rails and I am having a problem with generating controllers.
Some context :
$ rails -v
Rails 4.1.1
App is created correctly :
$ rails new test_app
create
create README.rdoc
create Rakefile
create config.ru
create .gitignore
create Gemfile
create app
[...]
Your bundle is complete!
Use `bundle show [gemname]` to see where a bundled gem is installed.
run bundle exec spring binstub --all
* bin/rake: spring inserted
* bin/rails: spring inserted
Server runs fine :
$ rails server
=> Booting WEBrick
=> Rails 4.1.1 application starting in development on http://0.0.0.0:3000
=> Run `rails server -h` for more startup options
=> Notice: server is listening on all interfaces (0.0.0.0). Consider using 127.0.0.1 (--binding option)
=> Ctrl-C to shutdown server
[2014-06-07 11:12:20] INFO WEBrick 1.3.1
[2014-06-07 11:12:20] INFO ruby 1.9.3 (2014-02-24) [x86_64-cygwin]
[2014-06-07 11:12:20] INFO WEBrick::HTTPServer#start: pid=3340 port=3000
I can browse the default page, but then when I try to go to the next step, it's failing :
$ rails generate controller welcome index
Nothing happens and the files are not generated. There is not output at all so I don't know where I should look to fix the issue.
I already tried creating a fresh new app and reinstalling rails, but this doesn't help.
Try to run
spring stop
rails generate may not work because spring is already running.
I had the same problem on my Windows machine while trying to run rails generate controller Users new
.
First, make sure your spring is not running. Stop it with spring stop
If it did not help THEN:
gem 'spring'
and gem 'spring-watcher-listen', '~> 2.0.0'
bundle update
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With