ruby on rails - undefined method `sub' for nil:NilClass when calling bundle exec db operations -
i getting following error:
undefined method `sub' nil:nilclass /users/jdrm/.rvm/gems/ruby-2.0.0-p247/gems/activerecord-3.2.13/lib/active_record/connection_adapters/abstract/connection_specification.rb:68:in `connection_url_to_hash'
when try run bundle exec db operation on rails project example:
bundle exec rake db:migrate
my os mac os x 10.8.4 , installed ruby using rvm , tried following versions:
ruby-1.9.3-p448 [ x86_64 ] ruby-2.0.0-p0 [ x86_64 ] ruby-2.0.0-p247 [ x86_64 ]
also tried rails 3.13 , 3.14.
i appreciate advise on problem.
the relevant code connection_specification.rb
:
spec = { :adapter => adapter, :username => config.user, :password => config.password, :port => config.port, => :database => config.path.sub(%r{^/},""), :host => config.host }
the error occurring because adapter doesn't have entry path database. however, if follow logic leads here, method converts uri configuration object. not intended.
so why happening? reason proper configuration isn't being found. check value have rails_env in environment (if any), , if matching configuration exists this.
Comments
Post a Comment