Project

General

Profile

Initial Configuration Fails with NameError

Added by Anonymous over 9 years ago

I'm trying to install Redmine 3 on a brand new, fully updated CentOS 7 VM. I've followed the instructions on RedmineInstall through to my failure at Step 5 ("session store secret generation").

Here's what happens:

[redmine@kropotkin redmine]$ rake generate_secret_token --trace
rake aborted!
NameError: uninitialized constant ActionView::Helpers::ActiveModelHelper
/usr/local/share/gems/gems/actionview-4.2.0/lib/action_view/helpers.rb:40:in `<module:Helpers>'
/usr/local/share/gems/gems/actionview-4.2.0/lib/action_view/helpers.rb:4:in `<module:ActionView>'
/usr/local/share/gems/gems/actionview-4.2.0/lib/action_view/helpers.rb:3:in `<top (required)>'
/usr/local/share/gems/gems/actionview-4.2.0/lib/action_view/base.rb:5:in `<top (required)>'
/usr/local/share/gems/gems/actionview-4.2.0/lib/action_view/view_paths.rb:1:in `<top (required)>'
/usr/local/share/gems/gems/actionpack-4.2.0/lib/abstract_controller/rendering.rb:4:in `<top (required)>'
/usr/local/share/gems/gems/actionpack-4.2.0/lib/action_controller/base.rb:204:in `<class:Base>'
/usr/local/share/gems/gems/actionpack-4.2.0/lib/action_controller/base.rb:164:in `<module:ActionController>'
/usr/local/share/gems/gems/actionpack-4.2.0/lib/action_controller/base.rb:5:in `<top (required)>'
/usr/local/share/gems/gems/actionpack-action_caching-1.1.1/lib/action_controller/action_caching.rb:13:in `<top (required)>'
/usr/local/share/gems/gems/actionpack-action_caching-1.1.1/lib/actionpack/action_caching.rb:1:in `require'
/usr/local/share/gems/gems/actionpack-action_caching-1.1.1/lib/actionpack/action_caching.rb:1:in `<top (required)>'
/usr/local/share/gems/gems/bundler-1.8.5/lib/bundler/runtime.rb:85:in `require'
/usr/local/share/gems/gems/bundler-1.8.5/lib/bundler/runtime.rb:85:in `rescue in block in require'
/usr/local/share/gems/gems/bundler-1.8.5/lib/bundler/runtime.rb:68:in `block in require'
/usr/local/share/gems/gems/bundler-1.8.5/lib/bundler/runtime.rb:61:in `each'
/usr/local/share/gems/gems/bundler-1.8.5/lib/bundler/runtime.rb:61:in `require'
/usr/local/share/gems/gems/bundler-1.8.5/lib/bundler.rb:134:in `require'
/usr/local/redmine/config/application.rb:5:in `<top (required)>'
/usr/share/rubygems/rubygems/core_ext/kernel_require.rb:53:in `require'
/usr/share/rubygems/rubygems/core_ext/kernel_require.rb:53:in `require'
/usr/local/redmine/Rakefile:5:in `<top (required)>'
/usr/local/share/gems/gems/rake-10.4.2/lib/rake/rake_module.rb:28:in `load'
/usr/local/share/gems/gems/rake-10.4.2/lib/rake/rake_module.rb:28:in `load_rakefile'
/usr/local/share/gems/gems/rake-10.4.2/lib/rake/application.rb:689:in `raw_load_rakefile'
/usr/local/share/gems/gems/rake-10.4.2/lib/rake/application.rb:94:in `block in load_rakefile'
/usr/local/share/gems/gems/rake-10.4.2/lib/rake/application.rb:176:in `standard_exception_handling'
/usr/local/share/gems/gems/rake-10.4.2/lib/rake/application.rb:93:in `load_rakefile'
/usr/local/share/gems/gems/rake-10.4.2/lib/rake/application.rb:77:in `block in run'
/usr/local/share/gems/gems/rake-10.4.2/lib/rake/application.rb:176:in `standard_exception_handling'
/usr/local/share/gems/gems/rake-10.4.2/lib/rake/application.rb:75:in `run'
/usr/local/share/gems/gems/rake-10.4.2/bin/rake:33:in `<top (required)>'
/usr/local/bin/rake:23:in `load'
/usr/local/bin/rake:23:in `<main>'

Here's what I've got installed:

[redmine@kropotkin redmine]$ gem list --local

*** LOCAL GEMS ***

actionmailer (4.2.0)
actionpack (4.2.0)
actionpack-action_caching (1.1.1)
actionpack-xml_parser (1.0.1)
actionview (4.2.0)
activejob (4.2.0)
activemodel (4.2.0)
activerecord (4.2.0)
activesupport (4.2.0)
arel (6.0.0)
bigdecimal (1.2.0)
builder (3.2.2)
bundler (1.8.5)
coderay (1.1.0)
erubis (2.7.0)
globalid (0.3.3)
hike (1.2.3)
i18n (0.7.0)
io-console (0.4.2)
jquery-rails (3.1.2)
json (1.8.2, 1.7.7)
loofah (2.0.1)
mail (2.6.3)
mime-types (2.4.3)
mini_portile (0.6.2)
minitest (5.5.1)
multi_json (1.11.0)
net-ldap (0.3.1)
nokogiri (1.6.6.2)
pg (0.17.1)
protected_attributes (1.0.8)
psych (2.0.0)
rack (1.6.0)
rack-openid (1.4.2)
rack-test (0.6.3)
rails (4.2.0)
rails-deprecated_sanitizer (1.0.3)
rails-dom-testing (1.0.5)
rails-html-sanitizer (1.0.2)
railties (4.2.0)
rake (10.4.2)
rbpdf (1.18.5)
rdoc (4.0.0)
redcarpet (3.1.2)
request_store (1.0.5)
rmagick (2.13.4)
ruby-openid (2.3.0)
sprockets (2.12.3)
sprockets-rails (2.2.4)
thor (0.19.1)
thread_safe (0.3.5)
tilt (1.4.1)
tzinfo (1.2.2)

Plus PostgreSQL 9.2.7 and Ruby 2.0.0.

This seems similar to, but is not the same as, the issues at http://www.redmine.org/boards/2/topics/45380 and here http://www.redmine.org/issues/18891.

The problem looks like it should be simple enough to solve, though I've never worked in Ruby before so I don't know how to troubleshoot it myself. I'd have included the config files already, but they don't seem related. I would be happy to provide any additional information. Thanks in advance for your advice!


Replies (10)

RE: Initial Configuration Fails with NameError - Added by Dmitriy Petrov over 9 years ago

Hi! Going here with your invitation. I had a similar problem, mine OS was Win2003, and ruby version was 2.2.1.
If you will see deeper, inspect what must be done with action "generate_secret_token" - it's very simple action, just generate random string and write it into file, no frameworks, no magic at all. So I think problem appears on loading ruby environment - all those modules, gems, frameworks... It seems that ruby just can not load it's modules, "autoload" operators do nothing for some reason.
Switching to ruby 2.0 version was solution for me.

RE: Initial Configuration Fails with NameError - Added by Anonymous over 9 years ago

Since I was already using Ruby 2.0.0, I couldn't switch to it. I don't know why my problems went away, but it works now. First I tried the 3.0.1 release, but that still didn't work. Then I uninstalled all the gems, installed as many gems as I could from system packages (I thought this would make it worse) then re-installed all the gems (many of them clobbering system gems).

Here's what I have installed now:

actionmailer (4.2.0)
actionpack (4.2.0)
actionpack-action_caching (1.1.1)
actionpack-xml_parser (1.0.1)
actionview (4.2.0)
activejob (4.2.0)
activemodel (4.2.0)
activerecord (4.2.0)
activesupport (4.2.0)
arel (6.0.0)
bigdecimal (1.2.0)
builder (3.2.2, 3.1.4)
bundler (1.8.5)
coderay (1.1.0)
erubis (2.7.0)
globalid (0.3.3)
hike (1.2.3)
i18n (0.7.0)
io-console (0.4.2)
jquery-rails (3.1.2)
json (1.8.2, 1.7.7)
loofah (2.0.1)
mail (2.6.3)
mime-types (2.4.3, 1.19)
mini_portile (0.6.2)
minitest (5.5.1, 4.3.2)
multi_json (1.11.0, 1.7.1)
net-ldap (0.6.1, 0.3.1)
nokogiri (1.6.6.2, 1.6.1)
pg (0.17.1)
protected_attributes (1.0.9)
psych (2.0.0)
rack (1.6.0, 1.5.2)
rack-openid (1.4.2)
rack-test (0.6.3)
rails (4.2.0)
rails-deprecated_sanitizer (1.0.3)
rails-dom-testing (1.0.6)
rails-html-sanitizer (1.0.2)
railties (4.2.0)
rake (10.4.2, 0.9.6)
rbpdf (1.18.5)
rdoc (4.0.0)
redcarpet (3.1.2)
request_store (1.0.5)
rmagick (2.13.4)
ruby-openid (2.3.0)
sprockets (2.12.3)
sprockets-rails (2.2.4)
thor (0.19.1, 0.17.0)
thread_safe (0.3.5)
tilt (1.4.1)
tzinfo (1.2.2)

So that doesn't appear to explain anything, but at least it works now!

RE: Initial Configuration Fails with NameError - Added by Toshi MARUYAMA over 9 years ago

Dmitriy Petrov wrote:

Hi! Going here with your invitation. I had a similar problem, mine OS was Win2003, and ruby version was 2.2.1.

See #19419.

RE: Initial Configuration Fails with NameError - Added by Yang Li over 9 years ago

I met the same problem. I'm using ruby 2.0.0 under centos 7 too.

RE: Initial Configuration Fails with NameError - Added by xat xat almost 9 years ago

I have exactly same issue with :
- CentOS Linux release 7.2.1511 (Core)
- ruby 2.0.0p598 (2014-11-13) [x86_64-linux]

Not able to fix it for the moment.

Thank you team

RE: Initial Configuration Fails with NameError - Added by Christian Rößner over 8 years ago

Hi, I can confirm this. Same problem. I can not continue with the installation.

Fully updated CentOS 7. Ruby from distribution. I installed rails with "gem install --no-user-install rails".

bundle install --without development test
Rubygems 2.0.14 is not threadsafe, so your gems will be installed one at a time. Upgrade to Rubygems 2.1.0 or higher to enable parallel gem installation.
Using rake 11.1.2
Using i18n 0.7.0
Using json 1.8.3
Using minitest 5.9.0
Using thread_safe 0.3.5
Using builder 3.2.2
Using erubis 2.7.0
Using mini_portile2 2.1.0
Using pkg-config 1.1.7
Using rack 1.6.4
Using mime-types-data 3.2016.0521
Using arel 6.0.3
Using addressable 2.4.0
Using coderay 1.1.1
Using concurrent-ruby 1.0.2
Using htmlentities 4.3.1
Using thor 0.19.1
Using mimemagic 0.3.1
Using mysql2 0.3.21
Using net-ldap 0.12.1
Using ruby-openid 2.3.0
Using bundler 1.12.5
Using rbpdf-font 1.19.0
Using redcarpet 3.3.4
Using request_store 1.0.5
Using rmagick 2.15.4
Using tzinfo 1.2.2
Using nokogiri 1.6.8
Using rack-test 0.6.3
Using mime-types 3.1
Using css_parser 1.3.7
Using sprockets 3.6.0
Using rack-openid 1.4.2
Using rbpdf 1.19.0
Using activesupport 4.2.5.2
Using loofah 2.0.3
Using mail 2.6.4
Using roadie 3.1.1
Using rails-deprecated_sanitizer 1.0.3
Using globalid 0.3.6
Using activemodel 4.2.5.2
Using rails-html-sanitizer 1.0.3
Using rails-dom-testing 1.0.7
Using activejob 4.2.5.2
Using activerecord 4.2.5.2
Using protected_attributes 1.1.3
Using actionview 4.2.5.2
Using actionpack 4.2.5.2
Using actionmailer 4.2.5.2
Using actionpack-action_caching 1.1.1
Using actionpack-xml_parser 1.0.2
Using railties 4.2.5.2
Using sprockets-rails 3.0.4
Using jquery-rails 3.1.4
Using roadie-rails 1.1.1
Using rails 4.2.5.2
Bundle complete! 31 Gemfile dependencies, 56 gems now installed.
Gems in the groups development and test were not installed.
Use `bundle show [gemname]` to see where a bundled gem is installed.

bundle exec rake generate_secret_token
rake aborted!
NameError: uninitialized constant ActionView::Helpers::ActiveModelHelper
/var/www/redmine/.gem/ruby/gems/actionview-4.2.5.2/lib/action_view/helpers.rb:40:in `<module:Helpers>'
/var/www/redmine/.gem/ruby/gems/actionview-4.2.5.2/lib/action_view/helpers.rb:4:in `<module:ActionView>'
/var/www/redmine/.gem/ruby/gems/actionview-4.2.5.2/lib/action_view/helpers.rb:3:in `<top (required)>'
/var/www/redmine/.gem/ruby/gems/actionview-4.2.5.2/lib/action_view/base.rb:5:in `<top (required)>'
/var/www/redmine/.gem/ruby/gems/actionview-4.2.5.2/lib/action_view/view_paths.rb:1:in `<top (required)>'
/var/www/redmine/.gem/ruby/gems/actionpack-4.2.5.2/lib/abstract_controller/rendering.rb:4:in `<top (required)>'
/var/www/redmine/.gem/ruby/gems/actionpack-4.2.5.2/lib/action_controller/base.rb:204:in `<class:Base>'
/var/www/redmine/.gem/ruby/gems/actionpack-4.2.5.2/lib/action_controller/base.rb:164:in `<module:ActionController>'
/var/www/redmine/.gem/ruby/gems/actionpack-4.2.5.2/lib/action_controller/base.rb:5:in `<top (required)>'
/var/www/redmine/.gem/ruby/gems/actionpack-action_caching-1.1.1/lib/action_controller/action_caching.rb:13:in `<top (required)>'
/var/www/redmine/.gem/ruby/gems/actionpack-action_caching-1.1.1/lib/actionpack/action_caching.rb:1:in `require'
/var/www/redmine/.gem/ruby/gems/actionpack-action_caching-1.1.1/lib/actionpack/action_caching.rb:1:in `<top (required)>'
/var/www/redmine/.gem/ruby/gems/bundler-1.12.5/lib/bundler/runtime.rb:100:in `require'
/var/www/redmine/.gem/ruby/gems/bundler-1.12.5/lib/bundler/runtime.rb:100:in `rescue in block in require'
/var/www/redmine/.gem/ruby/gems/bundler-1.12.5/lib/bundler/runtime.rb:77:in `block in require'
/var/www/redmine/.gem/ruby/gems/bundler-1.12.5/lib/bundler/runtime.rb:70:in `each'
/var/www/redmine/.gem/ruby/gems/bundler-1.12.5/lib/bundler/runtime.rb:70:in `require'
/var/www/redmine/.gem/ruby/gems/bundler-1.12.5/lib/bundler.rb:102:in `require'
/var/www/redmine/config/application.rb:5:in `<top (required)>'
/var/www/redmine/Rakefile:5:in `require'
/var/www/redmine/Rakefile:5:in `<top (required)>'
/var/www/redmine/.gem/ruby/gems/bundler-1.12.5/lib/bundler/cli/exec.rb:63:in `load'
/var/www/redmine/.gem/ruby/gems/bundler-1.12.5/lib/bundler/cli/exec.rb:63:in `kernel_load'
/var/www/redmine/.gem/ruby/gems/bundler-1.12.5/lib/bundler/cli/exec.rb:24:in `run'
/var/www/redmine/.gem/ruby/gems/bundler-1.12.5/lib/bundler/cli.rb:304:in `exec'
/var/www/redmine/.gem/ruby/gems/bundler-1.12.5/lib/bundler/vendor/thor/lib/thor/command.rb:27:in `run'
/var/www/redmine/.gem/ruby/gems/bundler-1.12.5/lib/bundler/vendor/thor/lib/thor/invocation.rb:126:in `invoke_command'
/var/www/redmine/.gem/ruby/gems/bundler-1.12.5/lib/bundler/vendor/thor/lib/thor.rb:359:in `dispatch'
/var/www/redmine/.gem/ruby/gems/bundler-1.12.5/lib/bundler/vendor/thor/lib/thor/base.rb:440:in `start'
/var/www/redmine/.gem/ruby/gems/bundler-1.12.5/lib/bundler/cli.rb:11:in `start'
/var/www/redmine/.gem/ruby/gems/bundler-1.12.5/exe/bundle:27:in `block in <top (required)>'
/var/www/redmine/.gem/ruby/gems/bundler-1.12.5/lib/bundler/friendly_errors.rb:98:in `with_friendly_errors'
/var/www/redmine/.gem/ruby/gems/bundler-1.12.5/exe/bundle:19:in `<top (required)>'
/var/www/redmine/bin/bundle:23:in `load'
/var/www/redmine/bin/bundle:23:in `<main>'
(See full trace by running task with --trace)

At this point I can not continue with the installation :-(

RE: Initial Configuration Fails with NameError - Added by Paulo Moreira over 8 years ago

Faced same issue:
CentOS 7
redmine-2.6.10 upgrade to 3.2.3

ruby 2.0.0p598 (2014-11-13) [x86_64-linux]
Rails 4.2.6

Overcome with:
gem uninstall nokogiri
bundle install
ruby rails server

RE: Initial Configuration Fails with NameError - Added by Timothy Farmer about 8 years ago

Paulo Moreira wrote:

Faced same issue:
CentOS 7
redmine-2.6.10 upgrade to 3.2.3

ruby 2.0.0p598 (2014-11-13) [x86_64-linux]
Rails 4.2.6

Overcome with:
gem uninstall nokogiri
bundle install
ruby rails server

Paulo,

Attempting to run bundle install without nokogiri causes a failure. How did you manage to get around that?

RE: Initial Configuration Fails with NameError - Added by Paulo Moreira about 8 years ago

Hello Timothy,

What is the failure cause?

RE: Initial Configuration Fails with NameError - Added by Timothy Farmer about 8 years ago

Same as the above messages.

[centos@ip-10-0-0-10 redmine-3.3.1]$ bundle exec rake generate_secret_token
Your bundle is locked to nokogiri (1.6.8.1), but that version could not be found in any of the sources listed in your Gemfile. If you haven't changed sources, that means the author of >nokogiri (1.6.8.1) has removed it. You'll need to update your bundle to a different version of nokogiri (1.6.8.1) that hasn't been removed in order to install.

Gem::Installer::ExtensionBuildError: ERROR: Failed to build gem native extension.

/usr/bin/ruby extconf.rb
checking if the C compiler accepts ... * extconf.rb failed *
Could not create Makefile due to some reason, probably lack of necessary
libraries and/or headers. Check the mkmf.log file for more details. You may
need configuration options.

Provided configuration options:
--with-opt-dir
--without-opt-dir
--with-opt-include
--without-opt-include=${opt-dir}/include
--with-opt-lib
--without-opt-lib=${opt-dir}/lib64
--with-make-prog
--without-make-prog
--srcdir=.
--curdir
--ruby=/usr/bin/ruby
--help
--clean
/usr/share/ruby/mkmf.rb:434:in `try_do': The compiler failed to generate an executable file. (RuntimeError)
You have to install development tools first.
from /usr/share/ruby/mkmf.rb:549:in `block in try_compile'
from /usr/share/ruby/mkmf.rb:500:in `with_werror'
from /usr/share/ruby/mkmf.rb:549:in `try_compile'
from extconf.rb:139:in `nokogiri_try_compile'
from extconf.rb:163:in `block in add_cflags'
from /usr/share/ruby/mkmf.rb:599:in `with_cflags'
from extconf.rb:162:in `add_cflags'
from extconf.rb:415:in `<main>'
Gem files will remain installed in /home/centos/.gem/ruby/gems/nokogiri-1.6.8.1 for inspection.
Results logged to /home/centos/.gem/ruby/gems/nokogiri-1.6.8.1/ext/nokogiri/gem_make.out>
An error occurred while installing nokogiri (1.6.8.1), and Bundler cannot continue.
[centos@ip-10-0-0-10 redmine-3.3.1]$ sudo gem install nokogiri -v '1.6.8.1' --no-ri --no-rdoc
Fetching: nokogiri-1.6.8.1.gem (100%)
Building native extensions. This could take a while...
Successfully installed nokogiri-1.6.8.1
1 gem installed

[centos@ip-10-0-0-10 redmine-3.3.1]$ bundle exec rake generate_secret_token rake aborted!
NameError: uninitialized constant ActionView::Helpers::ActiveModelHelper

    (1-10/10)