Top Menu

Jump to content
Home
    Modules
      • Projects
      • Activity
      • Work packages
      • Gantt charts
      • Calendars
      • Team planners
      • Boards
      • News
    • Getting started
    • Introduction video
      Welcome to OpenProject Community
      Get a quick overview of project management and team collaboration with OpenProject. You can restart this video from the help menu.

    • Help and support
    • Upgrade to Enterprise edition
    • User guides
    • Videos
    • Shortcuts
    • Community forum
    • Enterprise support

    • Additional resources
    • Data privacy and security policy
    • Digital accessibility (DE)
    • OpenProject website
    • Security alerts / Newsletter
    • OpenProject blog
    • Release notes
    • Report a bug
    • Development roadmap
    • Add and edit translations
    • API documentation
  • Sign in
      Forgot your password?

      or sign in with your existing account

      Google

Side Menu

  • Overview
  • Activity
    Activity
  • Roadmap
  • Work packages
    Work packages
  • Gantt charts
    Gantt charts
  • Calendars
    Calendars
  • Team planners
    Team planners
  • Boards
    Boards
  • News
  • Forums

Content

Support Installation & Updates
  1. OpenProject
  2. Forums
  3. Support Installation & Updates
  4. [Solved] OpenProject: Setup problems

[Solved] OpenProject: Setup problems

Added by Martin Böhm almost 11 years ago

According to https://www.openproject.org/projects/openproject/wiki/Debian_Stable_with_MySQL_in_production I tried to install OpenProject again.

Now I run into trouble at step 4.
According to http://stackoverflow.com/questions/18063777/geminstallerextensionbuilderror-error-failed-to-build-gem-native-extension I installed “sudo aptitude install ruby1.9.1-dev” to bypass the error.

Moreover I get failures at step 5, where I had to call:
[openproject@debian]# bundle exec rake db:create:all

Mysql2::Error: Can’t create database ‘openproject’; database exists: CREATE DATABASE `openproject` DEFAULT CHARACTER SET `utf8` COLLATE `utf8_unicode_ci`

Why the database is created again? How to solve it?

Thanks in advance.


Replies (11)

RE: OpenProject: Setup problems - Added by Christian Ratz almost 11 years ago

Hi Martin,

you should run the task ‘db:create:all’ only if the database(s) doesn’t exist. If the database already exist just go to the next step.

Best
Ratzi

RE: OpenProject: Setup problems - Added by Martin Böhm almost 11 years ago

Hi,

I think that https://www.openproject.org/projects/openproject/wiki/Debian_Stable_with_MySQL_in_production has many flaws. Thats very annoying.

Why do I create a Database at Step 2 and what is the intent of the commands at steps 5???

Moreover: If I delete the complete database openproject and thereafter call “bundle exec rake db:create:all” again, I get “Access denied for user ‘openproject’@‘localhost’” despite I created the user “openproject” and granted all priviledges at step 2.

What do the commands at step 5 mean? What do I need and what is useless?

[openproject@debian]# bundle exec rake db:migrate
[openproject@debian]# RAILS_ENV=“production” bundle exec rake db:seed
[openproject@debian]# bundle exec rake generate_secret_token
[openproject@debian]# RAILS_ENV=“production” bundle exec rake db:migrate
[openproject@debian]# RAILS_ENV=“production” bundle exec rake assets:precompile

Would be nice to have a working blue print of the installation procedure to get it simply running for the first time.

Thanks in advance.

RE: OpenProject: Setup problems - Added by Daniel Vanzo almost 11 years ago

Hi!, I have the same problem trying to use Postgress… Step 8 tells you to create the databases, then in Step 9 you have the command “bundle exec rake db:create:all”. It fails because the database already exists. Any idea how to continue with the initial setup?

Regards,

Daniel

RE: OpenProject: Setup problems - Added by Martin Böhm almost 11 years ago

Hi Daniel,

instead of “bundle exec rake db:create:all” you should omit “all” and try “RAILS_ENV=”production" bundle exec rake db:create".

To sum up:
[openproject@debian]# RAILS_ENV=“production” bundle exec rake db:create
[openproject@debian]# RAILS_ENV=“production” bundle exec rake generate_secret_token
[openproject@debian]# RAILS_ENV=“production” bundle exec rake db:seed
[openproject@debian]# RAILS_ENV=“production” bundle exec rake db:migrate
[openproject@debian]# RAILS_ENV=“production” bundle exec rake assets:precompile

Martin

RE: OpenProject: Setup problems - Added by Daniel Vanzo almost 11 years ago

Hi! and sorry the delay…

The first command was unsuscefull because it tells that the database already exists… The following commands executed ok…
Later, trying to starts the server fails again with the following text:

openproject@ServerTest01:~/openproject/config$ bundle exec rails server
require ‘rails/all’… 0.270s
Bundler.require… 1.620s
=> Booting Thin
=> Rails 3.2.18 application starting in development on http://0.0.0.0:3000
=> Call with -d to detach
=> Ctrl-C to shutdown server
Application.initialize!… Exiting
/home/openproject/.rvm/gems/ruby-2.1.2/gems/activerecord-3.2.18/lib/active_record/connection_adapters/abstract/connection_specification.rb:47:in `resolve_hash_connection’: database configuration does not specify adapter (ActiveRecord::AdapterNotSpecified)
from /home/openproject/.rvm/gems/ruby-2.1.2/gems/activerecord-3.2.18/lib/active_record/connection_adapters/abstract/connection_specification.rb:41:in `resolve_string_connection’
from /home/openproject/.rvm/gems/ruby-2.1.2/gems/activerecord-3.2.18/lib/active_record/connection_adapters/abstract/connection_specification.rb:25:in `spec’
from /home/openproject/.rvm/gems/ruby-2.1.2/gems/activerecord-3.2.18/lib/active_record/connection_adapters/abstract/connection_specification.rb:130:in `establish_connection’
from /home/openproject/.rvm/gems/ruby-2.1.2/gems/activerecord-3.2.18/lib/active_record/railtie.rb:88:in `block (2 levels) in class:Railtie’
from /home/openproject/.rvm/gems/ruby-2.1.2/gems/activesupport-3.2.18/lib/active_support/lazy_load_hooks.rb:36:in `instance_eval’
from /home/openproject/.rvm/gems/ruby-2.1.2/gems/activesupport-3.2.18/lib/active_support/lazy_load_hooks.rb:36:in `execute_hook’
from /home/openproject/.rvm/gems/ruby-2.1.2/gems/activesupport-3.2.18/lib/active_support/lazy_load_hooks.rb:26:in `block in on_load’
from /home/openproject/.rvm/gems/ruby-2.1.2/gems/activesupport-3.2.18/lib/active_support/lazy_load_hooks.rb:25:in `each’
from /home/openproject/.rvm/gems/ruby-2.1.2/gems/activesupport-3.2.18/lib/active_support/lazy_load_hooks.rb:25:in `on_load’
from /home/openproject/.rvm/gems/ruby-2.1.2/gems/activerecord-3.2.18/lib/active_record/railtie.rb:80:in `block in class:Railtie’
from /home/openproject/.rvm/gems/ruby-2.1.2/gems/railties-3.2.18/lib/rails/initializable.rb:30:in `instance_exec’
from /home/openproject/.rvm/gems/ruby-2.1.2/gems/railties-3.2.18/lib/rails/initializable.rb:30:in `run’
from /home/openproject/.rvm/gems/ruby-2.1.2/gems/railties-3.2.18/lib/rails/initializable.rb:55:in `block in run_initializers’
from /home/openproject/.rvm/gems/ruby-2.1.2/gems/railties-3.2.18/lib/rails/initializable.rb:54:in `each’
from /home/openproject/.rvm/gems/ruby-2.1.2/gems/railties-3.2.18/lib/rails/initializable.rb:54:in `run_initializers’
from /home/openproject/.rvm/gems/ruby-2.1.2/gems/railties-3.2.18/lib/rails/application.rb:136:in `initialize!’
from /home/openproject/.rvm/gems/ruby-2.1.2/gems/railties-3.2.18/lib/rails/railtie/configurable.rb:30:in `method_missing’
from /home/openproject/openproject/config/environment.rb:36:in `block in <top (required)>’
from /home/openproject/openproject/config/application.rb:44:in `block in bench’
from /home/openproject/.rvm/rubies/ruby-2.1.2/lib/ruby/2.1.0/benchmark.rb:279:in `measure’
from /home/openproject/openproject/config/application.rb:43:in `bench’
from /home/openproject/openproject/config/environment.rb:34:in `<top (required)>’
from /home/openproject/.rvm/gems/ruby-2.1.2/gems/activesupport-3.2.18/lib/active_support/dependencies.rb:251:in `require’
from /home/openproject/.rvm/gems/ruby-2.1.2/gems/activesupport-3.2.18/lib/active_support/dependencies.rb:251:in `block in require’
from /home/openproject/.rvm/gems/ruby-2.1.2/gems/activesupport-3.2.18/lib/active_support/dependencies.rb:236:in `load_dependency’
from /home/openproject/.rvm/gems/ruby-2.1.2/gems/activesupport-3.2.18/lib/active_support/dependencies.rb:251:in `require’
from /home/openproject/openproject/config.ru:32:in `block in

’
from /home/openproject/.rvm/gems/ruby-2.1.2/gems/rack-1.4.5/lib/rack/builder.rb:51:in `instance_eval’
from /home/openproject/.rvm/gems/ruby-2.1.2/gems/rack-1.4.5/lib/rack/builder.rb:51:in `initialize’
from /home/openproject/openproject/config.ru:in `new’
from /home/openproject/openproject/config.ru:in `

’
from /home/openproject/.rvm/gems/ruby-2.1.2/gems/rack-1.4.5/lib/rack/builder.rb:40:in `eval’
from /home/openproject/.rvm/gems/ruby-2.1.2/gems/rack-1.4.5/lib/rack/builder.rb:40:in `parse_file’
from /home/openproject/.rvm/gems/ruby-2.1.2/gems/rack-1.4.5/lib/rack/server.rb:200:in `app’
from /home/openproject/.rvm/gems/ruby-2.1.2/gems/railties-3.2.18/lib/rails/commands/server.rb:46:in `app’
from /home/openproject/.rvm/gems/ruby-2.1.2/gems/rack-1.4.5/lib/rack/server.rb:304:in `wrapped_app’
from /home/openproject/.rvm/gems/ruby-2.1.2/gems/rack-1.4.5/lib/rack/server.rb:254:in `start’
from /home/openproject/.rvm/gems/ruby-2.1.2/gems/railties-3.2.18/lib/rails/commands/server.rb:70:in `start’
from /home/openproject/.rvm/gems/ruby-2.1.2/gems/railties-3.2.18/lib/rails/commands.rb:55:in `block in <top (required)>’
from /home/openproject/.rvm/gems/ruby-2.1.2/gems/railties-3.2.18/lib/rails/commands.rb:50:in `tap’
from /home/openproject/.rvm/gems/ruby-2.1.2/gems/railties-3.2.18/lib/rails/commands.rb:50:in `<top (required)>’
from script/rails:6:in `require’
from script/rails:6:in `

’

Any idea?

Best regards,

Daniel

RE: OpenProject: Setup problems - Added by Philipp Tessenow almost 11 years ago

Hi Daniel,

can you show us your database.yml file? (with changed or removed passwords). I suspect that there is some typo in that file.

cheers,
Philipp

RE: RE: OpenProject: Setup problems - Added by Samy Ateia over 10 years ago

Hi i had the same problem i solved it by running:

“RAILS_ENV=”production" bundle exec rails server"
instead of just “bundle exec rails server”

but now if i visit the page it just looks like that:

and also the admin login is not working.

i followed this guide: https://www.openproject.org/projects/openproject/wiki/Installation_Ubuntu

RE: OpenProject: Setup problems - Added by Robin Wagner over 10 years ago

Hi Samy,

did you run the seed data for the production environment (to create an admin account)? Otherwise you would need to manually create an admin account to login.

RAILS_ENV="production" bundle exec rake db:seed

Did you precompile your assets?

RAILS_ENV="production" bundle exec rake assets:precompile

Best,
Robin

RE: OpenProject: Setup problems - Added by Samy Ateia over 10 years ago

I didn’t run seed. Now that i did, the admin login is working.

I also didn’t precompile the assets, but if i do they are still not found:

ActionController::RoutingError (No route matches [GET] "/assets/application-e488d7f0657ab8ee979c4976a4c3a0c1.js"):

But i can view the files in my browser if i directly access them.

I’m testing this on a virtual machine online, should i set my domain name somewhere?

Sry I’m new to ruby.

RE: OpenProject: Setup problems - Added by Samy Ateia over 10 years ago

Hi Again,
I fixed the problem.

you have to change this in
/config/environments/production.rb
# Disable Rails's static asset server (Apache or nginx will already do this)
config.serve_static_assets = false
to
config.serve_static_assets = true

if you want to use the build in webserver.

RE: OpenProject: Setup problems - Added by Robin Wagner over 10 years ago

Hi Samy,

sorry for the late reply.
Great to hear it’s working now. :)

Best,
Robin

  • (1 - 11/11)
Loading...