diff --git a/bin/refinerycms b/bin/refinerycms index 39efadea05..5ba9bde331 100755 --- a/bin/refinerycms +++ b/bin/refinerycms @@ -116,7 +116,14 @@ module Refinery bundle! # Ensure the database exists so that queries like .table_exists? don't fail. - run_command("rake -f \"#{@app_path.join('Rakefile')}\" db:create") + puts "\nCreating a new database.." + # Warn about incorrect username or password. + unless @options[:database][:adapter] == 'sqlite3' + note = "NOTE: if your database username is not '#{@options[:database][:username]}'" + note << " or your password is not '#{@options[:database][:password]}' then the installer will stop working here.\n\n" + puts note + end + run_command("rake -f \"#{@app_path.join('Rakefile')}\" db:create", {:fail => "Unable to create the application's database"}) else # Update the current application. update! @@ -242,8 +249,10 @@ module Refinery if !$?.success? or rails_output.to_s.length == 0 or rails_output =~ /^(Can't\ initialize|Error)/ puts "Generating Rails application failed. Exiting..." exit(1) - elsif defined? JRUBY_VERSION - find_and_replace(@app_path.join('Gemfile'), /['|"]sqlite3['|"]/, "'activerecord-jdbcsqlite3-adapter'") + else + if defined? JRUBY_VERSION + find_and_replace(@app_path.join('Gemfile'), /['|"]sqlite3['|"]/, "'activerecord-jdbcsqlite3-adapter'") + end # Override username and password find_and_replace('config/database.yml', %r{username:.*}, "username: #{@options[:database][:username]}")