Cannot run rails generate administrate:install
Created by: nguyen7thai
Hi All,
I'm trying gem administrate but I encounter the problem when running the command generate administrate:install
.
As I investigated, the problem is because of this lines of code in namespace.rb:
def resources
namespace_controller_paths.uniq.map do |controller|
controller.gsub(/^#{namespace}\//, "").to_sym
end
end
Its returned value includes the symbol that is created from empty string :""
.
Does anyone encounter this error?
Here's the backtrace:
/Users/bebe/.rvm/gems/ruby-2.2.3@administrate/gems/railties-4.2.4/lib/rails/generators/named_base.rb:102:in block in class_name': undefined method
camelize' for nil:NilClass (NoMethodError)
from /Users/bebe/.rvm/gems/ruby-2.2.3@administrate/gems/railties-4.2.4/lib/rails/generators/named_base.rb:102:in map!' from /Users/bebe/.rvm/gems/ruby-2.2.3@administrate/gems/railties-4.2.4/lib/rails/generators/named_base.rb:102:in
class_name'
from (erb):3:in template' from /Users/bebe/.rvm/rubies/ruby-2.2.3/lib/ruby/2.2.0/erb.rb:863:in
eval'
from /Users/bebe/.rvm/rubies/ruby-2.2.3/lib/ruby/2.2.0/erb.rb:863:in result' from /Users/bebe/.rvm/gems/ruby-2.2.3@administrate/gems/thor-0.19.1/lib/thor/actions/file_manipulation.rb:116:in
block in template'
from /Users/bebe/.rvm/gems/ruby-2.2.3@administrate/gems/thor-0.19.1/lib/thor/actions/create_file.rb:53:in call' from /Users/bebe/.rvm/gems/ruby-2.2.3@administrate/gems/thor-0.19.1/lib/thor/actions/create_file.rb:53:in
render'
from /Users/bebe/.rvm/gems/ruby-2.2.3@administrate/gems/thor-0.19.1/lib/thor/actions/create_file.rb:46:in identical?' from /Users/bebe/.rvm/gems/ruby-2.2.3@administrate/gems/thor-0.19.1/lib/thor/actions/create_file.rb:72:in
on_conflict_behavior'
from /Users/bebe/.rvm/gems/ruby-2.2.3@administrate/gems/thor-0.19.1/lib/thor/actions/empty_directory.rb:113:in invoke_with_conflict_check' from /Users/bebe/.rvm/gems/ruby-2.2.3@administrate/gems/thor-0.19.1/lib/thor/actions/create_file.rb:60:in
invoke!'
from /Users/bebe/.rvm/gems/ruby-2.2.3@administrate/gems/thor-0.19.1/lib/thor/actions.rb:94:in action' from /Users/bebe/.rvm/gems/ruby-2.2.3@administrate/gems/thor-0.19.1/lib/thor/actions/create_file.rb:25:in
create_file'
from /Users/bebe/.rvm/gems/ruby-2.2.3@administrate/gems/thor-0.19.1/lib/thor/actions/file_manipulation.rb:115:in template' from /Users/bebe/.rvm/gems/ruby-2.2.3@administrate/gems/railties-4.2.4/lib/rails/generators/named_base.rb:26:in
block in template'
from /Users/bebe/.rvm/gems/ruby-2.2.3@administrate/gems/railties-4.2.4/lib/rails/generators/named_base.rb:60:in inside_template' from /Users/bebe/.rvm/gems/ruby-2.2.3@administrate/gems/railties-4.2.4/lib/rails/generators/named_base.rb:25:in
template'
from /Users/bebe/.rvm/gems/ruby-2.2.3@administrate/gems/administrate-0.1.4/lib/generators/administrate/dashboard/dashboard_generator.rb:30:in create_dashboard_definition' from /Users/bebe/.rvm/gems/ruby-2.2.3@administrate/gems/thor-0.19.1/lib/thor/command.rb:27:in
run'
from /Users/bebe/.rvm/gems/ruby-2.2.3@administrate/gems/thor-0.19.1/lib/thor/invocation.rb:126:in invoke_command' from /Users/bebe/.rvm/gems/ruby-2.2.3@administrate/gems/thor-0.19.1/lib/thor/invocation.rb:133:in
block in invoke_all'
from /Users/bebe/.rvm/gems/ruby-2.2.3@administrate/gems/thor-0.19.1/lib/thor/invocation.rb:133:in each' from /Users/bebe/.rvm/gems/ruby-2.2.3@administrate/gems/thor-0.19.1/lib/thor/invocation.rb:133:in
map'
from /Users/bebe/.rvm/gems/ruby-2.2.3@administrate/gems/thor-0.19.1/lib/thor/invocation.rb:133:in invoke_all' from /Users/bebe/.rvm/gems/ruby-2.2.3@administrate/gems/thor-0.19.1/lib/thor/group.rb:232:in
dispatch'
from /Users/bebe/.rvm/gems/ruby-2.2.3@administrate/gems/thor-0.19.1/lib/thor/base.rb:440:in start' from /Users/bebe/.rvm/gems/ruby-2.2.3@administrate/gems/railties-4.2.4/lib/rails/generators.rb:157:in
invoke'
from /Users/bebe/.rvm/gems/ruby-2.2.3@administrate/gems/administrate-0.1.4/lib/administrate/generator_helpers.rb:4:in call_generator' from /Users/bebe/.rvm/gems/ruby-2.2.3@administrate/gems/administrate-0.1.4/lib/generators/administrate/install/install_generator.rb:27:in
block in run_dashboard_generators'
from /Users/bebe/.rvm/gems/ruby-2.2.3@administrate/gems/administrate-0.1.4/lib/generators/administrate/install/install_generator.rb:26:in each' from /Users/bebe/.rvm/gems/ruby-2.2.3@administrate/gems/administrate-0.1.4/lib/generators/administrate/install/install_generator.rb:26:in
run_dashboard_generators'