You are not logged in.

#1 2013-05-15 12:05:14

Registered: 2013-05-15
Posts: 35

Cant get redmine to run with lighttpd under Arch

Hi, I posted this already in the Redmine forum but I get no answer there since yesterday, so therefore I am trying here now hoping that someone gets me a hint.
Searching the error with google finds solutions but none of them works for me (Mostly "seems you got no bundle installed", I have that).

I am trying the whole day to get lighttpd to run with redmine, but I can not get a solution to that error.

May 14 17:50:04 redmine lighttpd-angel[586]: /usr/lib/ruby/site_ruby/2.0.0/rubygems/core_ext/kernel_require.rb:45:in `require': cannot load such file -- bundler/setup (LoadError)
May 14 17:50:04 redmine lighttpd-angel[586]: from /usr/lib/ruby/site_ruby/2.0.0/rubygems/core_ext/kernel_require.rb:45:in `require'
May 14 17:50:04 redmine lighttpd-angel[586]: from /srv/http/redmine/config/boot.rb:6:in `<top (required)>'
May 14 17:50:04 redmine lighttpd-angel[586]: from /usr/lib/ruby/site_ruby/2.0.0/rubygems/core_ext/kernel_require.rb:45:in `require'
May 14 17:50:04 redmine lighttpd-angel[586]: from /usr/lib/ruby/site_ruby/2.0.0/rubygems/core_ext/kernel_require.rb:45:in `require'
May 14 17:50:04 redmine lighttpd-angel[586]: from /srv/http/redmine/public/dispatch.fcgi:3:in `<main>'
I searched the web for "cannot load such file -- bundler/setup (LoadError)" and I get some results but none of the solutions helped.
I got all gems installed and the test with "ruby script/rails server webrick -e production" runs, bringing up a working redmine on localhost:3000 however lighttpd keeps crashing.

Here the versions that I have installed

 # cd /srv/http/redmine
 # bundle install
 Using <various gems>
 Your bundle is complete!
 Gems in the groups development and test were not installed.
 Use `bundle show [gemname]` to see where a bundled gem is installed.
 # ruby --version
 ruby 2.0.0p0 (2013-02-24 revision 39474) [x86_64-linux]
 # gem --version
 # rake --version
 rake, version 10.0.4
 # bundle --version
 Bundler version 1.3.5

I am running archlinux and that's not the first webserver I set up with arch, however the first attempt with ruby and lighttpd. Testing redmine with unicorn or webrick works, the site is up, I can login as admin and create users and content, but I can not use unicorn or webrick, because I need SSL for redmine...

I am quite lost now, how can I get the thing up?


#2 2013-05-17 07:46:44

Registered: 2013-05-15
Posts: 35

Re: Cant get redmine to run with lighttpd under Arch

I managed to set up lighttpd and redmine on debian now, because there was a package in the official repository. I don't know what problems the package solved, I still would like to use archlinux, but since there is no official package, my manual install failed. I still wonder what I did wrong...


#3 2013-07-04 11:55:16

Registered: 2012-07-02
Posts: 3

Re: Cant get redmine to run with lighttpd under Arch

You didn't include the root cause of  the error - it's somewhere more up in the error log. Rerunning systemctl like this should get you better feedback.

systemctl --full -n 100 status lighttpd

Anyway no matter the cause it's likely not the only problem you can run into while setting up redmine - so i'll give you my entire step-by-step configuration with php that works  (Tested it all in virtualbox with latest packages) and you might figure out what you did wrong.

Make sure you have installed the neccessary stuff - in my case following

pacman --needed --noconfirm -S mariadb mariadb-clients subversion ruby imagemagick lighttpd php php-cgi php-fpm fcgi base-devel

Get redmine

[ -d /srv/http ] || mkdir -p /srv/http
cd /srv/http
svn co redmine
cd redmine

Create database access for redmine

mysql -u root -e "CREATE DATABASE redmine CHARACTER SET utf8;"
mysql -u root -e "CREATE USER 'redmine'@'localhost' IDENTIFIED BY 'my_password';"
mysql -u root -e "GRANT ALL PRIVILEGES ON redmine.* TO 'redmine'@'localhost';"

Copy database config and modify the desired sections of file accordingly

cp config/database.yml.example config/database.yml
  adapter: mysql2
  database: redmine
  host: localhost
  username: redmine
  password: my_password
  encoding: utf8

Install gems and setup redmine

cp public/dispatch.fcgi.example public/dispatch.fcgi
gem install bundler --no-user-install
echo 'gem "fcgi"' > Gemfile.local
bundle install --without development test
rake generate_secret_token
RAILS_ENV=production rake db:migrate
RAILS_ENV=production REDMINE_LANG=en rake redmine:load_default_data

Modify permissions

mkdir -p files log tmp tmp/pdf public/plugin_assets
chown -R http:http files log tmp public/plugin_assets
chmod -R 755 files log tmp public/plugin_assets

Test redmine

ruby script/rails server webrick -e production -p 8080

Configure your /etc/lighttpd/lighttpd.conf - here is mine.

Now if your redmine runs in subdirectory (like mine) fix the routes in 'config/routes.rb' by replacing

RedmineApp::Application.routes.draw do
  root :to => 'welcome#index', :as => 'home'


Redmine::Utils::relative_url_root = '/redmine'
RedmineApp::Application.routes.draw do
  scope ActionController::Base.relative_url_root do
    root :to => 'welcome#index', :as => 'home'

Don't forget to add an extra 'end' to the end of file and you should be done. Start your lighttpd and visit your redmine. For futher debug check what's in the following
systemctl --full -n 100 status lighttpd
your lighttpd error log

Hope i helped you - so drop me a feedback smile

Edit: Guess it's obvious, but make sure the user that runs lighttpd has all permissions for the folders in which you create sockets...

Last edited by markocz (2013-07-04 12:09:02)


#4 2014-04-24 19:47:39

From: Buenos Aires - Argentina
Registered: 2010-02-02
Posts: 16

Re: Cant get redmine to run with lighttpd under Arch

EDIT: I missed the "echo fcgi" command in markocz's instructions. My bad. Sorry for the noise.


I followed markocz's instructions almost exactly and got this error:

# ./public/dispatch.fcgi
/usr/lib/ruby/gems/2.1.0/gems/activerecord-3.2.17/lib/active_record/connection_adapters/abstract/connection_specification.rb:47:in `resolve_hash_connection': database configuration does not specify adapter (ActiveRecord::AdapterNotSpecified)
        from /usr/lib/ruby/gems/2.1.0/gems/activerecord-3.2.17/lib/active_record/connection_adapters/abstract/connection_specification.rb:41:in `resolve_string_connection'
        from /usr/lib/ruby/gems/2.1.0/gems/activerecord-3.2.17/lib/active_record/connection_adapters/abstract/connection_specification.rb:25:in `spec'
        from /usr/lib/ruby/gems/2.1.0/gems/activerecord-3.2.17/lib/active_record/connection_adapters/abstract/connection_specification.rb:130:in `establish_connection'
        from /usr/lib/ruby/gems/2.1.0/gems/activerecord-3.2.17/lib/active_record/railtie.rb:88:in `block (2 levels) in <class:Railtie>'
        from /usr/lib/ruby/gems/2.1.0/gems/activesupport-3.2.17/lib/active_support/lazy_load_hooks.rb:36:in `instance_eval'
        from /usr/lib/ruby/gems/2.1.0/gems/activesupport-3.2.17/lib/active_support/lazy_load_hooks.rb:36:in `execute_hook'
        from /usr/lib/ruby/gems/2.1.0/gems/activesupport-3.2.17/lib/active_support/lazy_load_hooks.rb:26:in `block in on_load'
        from /usr/lib/ruby/gems/2.1.0/gems/activesupport-3.2.17/lib/active_support/lazy_load_hooks.rb:25:in `each'
        from /usr/lib/ruby/gems/2.1.0/gems/activesupport-3.2.17/lib/active_support/lazy_load_hooks.rb:25:in `on_load'
        from /usr/lib/ruby/gems/2.1.0/gems/activerecord-3.2.17/lib/active_record/railtie.rb:80:in `block in <class:Railtie>'
        from /usr/lib/ruby/gems/2.1.0/gems/railties-3.2.17/lib/rails/initializable.rb:30:in `instance_exec'
        from /usr/lib/ruby/gems/2.1.0/gems/railties-3.2.17/lib/rails/initializable.rb:30:in `run'
        from /usr/lib/ruby/gems/2.1.0/gems/railties-3.2.17/lib/rails/initializable.rb:55:in `block in run_initializers'
        from /usr/lib/ruby/gems/2.1.0/gems/railties-3.2.17/lib/rails/initializable.rb:54:in `each'
        from /usr/lib/ruby/gems/2.1.0/gems/railties-3.2.17/lib/rails/initializable.rb:54:in `run_initializers'
        from /usr/lib/ruby/gems/2.1.0/gems/railties-3.2.17/lib/rails/application.rb:136:in `initialize!'
        from /usr/lib/ruby/gems/2.1.0/gems/railties-3.2.17/lib/rails/railtie/configurable.rb:30:in `method_missing'
        from /srv/http/sc-redmine/config/environment.rb:14:in `<top (required)>'
        from ./public/dispatch.fcgi:7:in `require'
        from ./public/dispatch.fcgi:7:in `<main>'

I found this to be the solution: add

gem "fcgi"

to Gemfile.local and rerun

bundle install … t-load-suc

Thanks markocz!

Last edited by falbani (2014-04-28 18:36:31)


Board footer

Powered by FluxBB