Question

I've decided to learn Rails but it keeps on throwing problems at me. I managed to solve them myself but this one just wont go away. I'm following this guide but when I try to create a new controller with rails generate controller welcome index I get this error:

    Constantins-MacBook-Pro-2:n00b Constantin$ rails generate controller welcome index
/Users/Constantin/.rvm/gems/ruby-2.1.1@n00b/gems/activesupport-4.1.0/lib/active_support/dependencies.rb:241:in `load': no implicit conversion of nil into String (TypeError)
    from /Users/Constantin/.rvm/gems/ruby-2.1.1@n00b/gems/activesupport-4.1.0/lib/active_support/dependencies.rb:241:in `block in load'
    from /Users/Constantin/.rvm/gems/ruby-2.1.1@n00b/gems/activesupport-4.1.0/lib/active_support/dependencies.rb:232:in `load_dependency'
    from /Users/Constantin/.rvm/gems/ruby-2.1.1@n00b/gems/activesupport-4.1.0/lib/active_support/dependencies.rb:241:in `load'
    from /Users/Constantin/.rvm/rubies/ruby-2.1.1/lib/ruby/2.1.0/rubygems/core_ext/kernel_require.rb:55:in `require'
    from /Users/Constantin/.rvm/rubies/ruby-2.1.1/lib/ruby/2.1.0/rubygems/core_ext/kernel_require.rb:55:in `require'
    from -e:1:in `<main>'

Form what I've found online it means that the compiler is running through my application every time I create new controllers etc. and then finds these errors. Correct? But since I haven't edited a single line of code yet I don't understand where these come from nor what he is trying to tell me. It's probably something else that I missed but I just can't find a solution to it neither online nor from try 'n error.

Thanks in advance

Was it helpful?

Solution

It looks like you're in your home directory. To generate a rails controller you should be in the directory of the rails application you want to modify.

edit: If this isn't the case, paste what happens when you do this (from a clean directory):

rails new new-app
cd new-app
rails g controller welcome index
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top