Could not find "config/databases/sqlserver.yml" in any of your source paths #6882

Closed
sgonyea opened this Issue Jun 27, 2012 · 18 comments

5 participants

@sgonyea

It seems that the sqlserver database configuration has vanished? Running the following under jruby (though I don't think the ruby matters), on rails 3.2.6:

rails new foo -d sqlserver

Yields the following output:

rails new foo -d sqlserver      create  
      create  README.rdoc
      create  Rakefile
      create  config.ru
      create  .gitignore
      create  Gemfile
      create  app
      create  app/assets/images/rails.png
      create  app/assets/javascripts/application.js
      create  app/assets/stylesheets/application.css
      create  app/controllers/application_controller.rb
      create  app/helpers/application_helper.rb
      create  app/mailers
      create  app/models
      create  app/views/layouts/application.html.erb
      create  app/mailers/.gitkeep
      create  app/models/.gitkeep
      create  config
      create  config/routes.rb
      create  config/application.rb
      create  config/environment.rb
      create  config/environments
      create  config/environments/development.rb
      create  config/environments/production.rb
      create  config/environments/test.rb
      create  config/initializers
      create  config/initializers/backtrace_silencers.rb
      create  config/initializers/inflections.rb
      create  config/initializers/mime_types.rb
      create  config/initializers/secret_token.rb
      create  config/initializers/session_store.rb
      create  config/initializers/wrap_parameters.rb
      create  config/locales
      create  config/locales/en.yml
      create  config/boot.rb
Could not find "config/databases/sqlserver.yml" in any of your source paths. Your current source paths are: 
/Users/sgonyea/.rbenv/versions/jruby-1.6.7.2/lib/ruby/gems/1.8/gems/railties-3.2.6/lib/rails/generators/rails/app/templates
@steveklabnik
Ruby on Rails member

Can you show me the output of ls? I have a hunch that it's either a dup or related to #6010 and or #6868.

@sgonyea

You're fast. I tested this in ruby 1.9.3 and jruby (with --1.9). I also hit this issue with both rails 3.1.6 and 3.2.6.

My pwd is /usr/local/share/workspace

and cd foo && ls -al yields:

sgonyea@s:/usr/local/share/workspace/foo$ ls -al
total 28
drwxr-xr-x+   9 sgonyea tc-dev  306 Jun 27 12:58 .
drwxrwxr-x+ 108 dev     tc-dev 3672 Jun 27 12:58 ..
-rw-r--r--+   1 sgonyea tc-dev  430 Jun 27 12:58 .gitignore
-rw-r--r--+   1 sgonyea tc-dev  785 Jun 27 12:58 Gemfile
-rw-r--r--+   1 sgonyea tc-dev 9208 Jun 27 12:58 README.rdoc
-rw-r--r--+   1 sgonyea tc-dev  268 Jun 27 12:58 Rakefile
drwxr-xr-x+   8 sgonyea tc-dev  272 Jun 27 12:58 app
drwxr-xr-x+   9 sgonyea tc-dev  306 Jun 27 12:58 config
-rw-r--r--+   1 sgonyea tc-dev  153 Jun 27 12:58 config.ru
@sgonyea

I don't think this has anything to do with those other issues. It looks like the way in which generators happen got shuffled around, and this either was dropped or never accounted for.

The file is just not there:

sgonyea@s:/usr/local/share/workspace/foo$ l /Users/sgonyea/.rbenv/versions/jruby-1.6.7.2/lib/ruby/gems/1.8/gems/railties-3.2.6/lib/rails/generators/rails/app/templates/config/databases/
total 40K
drwxr-xr-x+ 12 sgonyea tc-dev  408 Jun 19 21:41 ./
drwxr-xr-x+ 10 sgonyea tc-dev  340 Jun 19 21:41 ../
-rw-r--r--+  1 sgonyea tc-dev  713 Jun 19 21:41 frontbase.yml
-rw-r--r--+  1 sgonyea tc-dev 2.1K Jun 19 21:41 ibm_db.yml
-rw-r--r--+  1 sgonyea tc-dev 1.8K Jun 19 21:41 jdbc.yml
-rw-r--r--+  1 sgonyea tc-dev  830 Jun 19 21:41 jdbcmysql.yml
-rw-r--r--+  1 sgonyea tc-dev 1.3K Jun 19 21:41 jdbcpostgresql.yml
-rw-r--r--+  1 sgonyea tc-dev  513 Jun 19 21:41 jdbcsqlite3.yml
-rw-r--r--+  1 sgonyea tc-dev 1.2K Jun 19 21:41 mysql.yml
-rw-r--r--+  1 sgonyea tc-dev 1.1K Jun 19 21:41 oracle.yml
-rw-r--r--+  1 sgonyea tc-dev 1.5K Jun 19 21:41 postgresql.yml
-rw-r--r--+  1 sgonyea tc-dev  576 Jun 19 21:41 sqlite3.yml
@steveklabnik
Ruby on Rails member

You're fast

I happened to have my email open when you filed the bug. ;)

Thanks for taking the time to delve in a bit deeper.

@sgonyea

I'll make a pull request to add it.

@sgonyea

This will take a bit of time to work on. Should I just focus on JDBC sqlserver, since that's all I care about, or should I try to cover the driver you'd use with MRI? (I have doubts it'd work with Rubinius, but I could test that as well.)

@schneems
Ruby on Rails member

ping, have you had a chance to make a PR for this? If doing all of them is too much work just sqlserver would be fine. If you're not going to work on a PR, can you let us know and we can close this issue or have someone else potentially work on it?

@rnesius

5 months later - using latest stable rails the problem persists...

Could not find "config/databases/sqlserver.yml" in any of your source paths. Your current source paths are:
/usr/local/rvm/gems/ruby-1.9.3-p125/gems/railties-3.2.9/lib/rails/generators/rails/app/templates

If 'rails new --help' advertises sqlserver as an option (which it does), it should work?

ls /usr/local/rvm/gems/ruby-1.9.3-p125/gems/railties-3.2.9/lib/rails/generators/rails/app/templates/config/databases/
frontbase.yml jdbcmysql.yml jdbcsqlite3.yml mysql.yml postgresql.yml
ibm_db.yml jdbcpostgresql.yml jdbc.yml oracle.yml sqlite3.yml

@schneems
Ruby on Rails member

@rnesius yes, it should. Would you care to work on this? @sgonyea does not appear to be working on this issue.

@rnesius

I'm no the most git-savvy person out there, but it looks like it's just a matter of building out a reasonable template and submitting a pull request? I can probably do that.

@steveklabnik
Ruby on Rails member

I'm not the most AR-savvy person, but yes, I think so.

Before submitting your pull request, you can test it out with your app by doing this: http://blog.steveklabnik.com/posts/2012-10-04-run-rails-with-custom-patches

@rnesius

Thanks for the tip. I'll take a crack at it.

@rnesius

I have successfully implemented/tested a fix. Reading online guides now to get a proper pull request submitted. It has taken me longer to jump through hoops with git and read submission guides than to do the fix.

@rafaelfranca
Ruby on Rails member

Closed by #8247

@steveklabnik
Ruby on Rails member

It has taken me longer to jump through hoops with git and read submission guides than to do the fix.

At the very least, it's a one-time cost. Now you can visit this page every time you get another commit in. :)

@rnesius

Hah! Thanks Steve! :) One more commit and I'm in the top 800! ;-)

@steveklabnik
Ruby on Rails member

Yep! It's a quick and steady rise at first...

@schneems
Ruby on Rails member

Thanks @rnesius many people open bugs on AR, few bother to submit PRs, your work is appreciated. ❤️

@fun-ruby fun-ruby added a commit to fun-ruby/rails that referenced this issue Oct 28, 2013
@fun-ruby fun-ruby Back-port missing sqlserver.yml template (from rails 4.0.0) to really…
… close out #6882
3094b10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment