Hello,
First, SORRY for the long post!
I'm trying to setup Foreman 1.2 and get to the point of migrating to MySQL
and get the following error:
rake aborted!
no such file to load – rails/all
/usr/share/foreman/Rakefile:1
(See full trace by running task with --trace)
RAILS_ENV=production rake db:migrate --trace
(in /usr/share/foreman)
rake aborted!
no such file to load – rails/all
/usr/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in
gem_original_require' /usr/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in
require'
/usr/share/foreman/config/application.rb:3
/usr/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in
gem_original_require' /usr/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in
require'
/usr/share/foreman/Rakefile:1
/usr/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:2382:in load' /usr/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:2382:in
raw_load_rakefile'
/usr/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:2016:in load_rakefile' /usr/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:2067:in
standard_exception_handling'
/usr/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:2015:in load_rakefile' /usr/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:1999:in
run'
/usr/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:2067:in
standard_exception_handling' /usr/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:1997:in
run'
/usr/lib/ruby/gems/1.8/gems/rake-0.8.7/bin/rake:31
/usr/bin/rake:19:in `load'
/usr/bin/rake:19
I read somewhere it was suggested for Foreman 1.2 to run
cd ~foreman && sudo -u foreman scl enable ruby193 'RAILS_ENV=production
rake db:migrate'
cd ~foreman && sudo -u foreman scl enable ruby193 'RAILS_ENV=production
rake db:migrate --trace'
** Invoke db:migrate (first_time)
** Invoke environment (first_time)
** Execute environment
rake aborted!
Please install the mysql2 adapter: gem install activerecord-mysql2-adapter
(Could not find mysql2 (~> 0.3.10) amongst
[actionmailer-3.2.8, actionpack-3.2.8, activemodel-3.2.8,
activerecord-3.2.8, activeresource-3.2.8, activesupport-3.2.8,
ancestry-1.3.0, apipie-rails-0.0.18, arel-3.0.2, audited-3.0.0,
audited-activerecord-3.0.0, bigdecimal-1.1.0, builder-3.0.0, bundler-1.1.4,
bundler_ext-0.3.0, coffee-rails-3.2.2, coffee-script-2.2.0,
coffee-script-source-1.3.3, daemon_controller-1.1.4, daemons-1.1.4,
diff-lcs-1.1.3, erubis-2.7.0, eventmachine-0.12.10, execjs-1.4.0,
fast_gettext-0.5.10, gettext_i18n_rails-0.9.4, gettext_i18n_rails_js-0.0.8,
hike-1.2.1, i18n-0.6.0, i18n_data-0.2.7, io-console-0.3, journey-1.0.4,
jquery-rails-2.0.2, jquery-ui-rails-4.0.2, json-1.5.4, mail-2.4.4,
mime-types-1.19, multi_json-1.3.6, net-http-persistent-2.7, net-ldap-0.3.1,
oauth-0.4.7, passenger-4.0.5, pg-0.12.2, po_to_json-0.0.7, polyglot-0.3.3,
rabl-0.7.6, rack-1.4.1, rack-cache-1.2, rack-ssl-1.3.2, rack-test-0.6.1,
rails-3.2.8, railties-3.2.8, rake-0.9.2.2, rdoc-3.12, ref-1.0.0,
rest-client-1.6.1, ruby2ruby-2.0.1, ruby_parser-3.1.1, safemode-1.2.0,
sass-3.1.20, sass-rails-3.2.5, scoped_search-2.5.1, sexp_processor-4.1.3,
sprockets-2.4.5, therubyracer-0.11.0beta5, thin-1.3.1, thor-0.15.4,
tilt-1.3.3, treetop-1.4.10, twitter-bootstrap-rails-2.2.6, tzinfo-0.3.33,
uglifier-1.2.6, uuidtools-2.1.3, will_paginate-3.0.2])
/opt/rh/ruby193/root/usr/share/rubygems/rubygems/dependency.rb:247:in
to_specs' /opt/rh/ruby193/root/usr/share/rubygems/rubygems/dependency.rb:256:in
to_spec'
/opt/rh/ruby193/root/usr/share/rubygems/rubygems.rb:1231:in gem' /opt/rh/ruby193/root/usr/share/gems/gems/activerecord-3.2.8/lib/active_record/connection_adapters/mysql2_adapter.rb:3:in
<top (required)>'
/opt/rh/ruby193/root/usr/share/rubygems/rubygems/custom_require.rb:60:in
require' /opt/rh/ruby193/root/usr/share/rubygems/rubygems/custom_require.rb:60:in
rescue in require'
/opt/rh/ruby193/root/usr/share/rubygems/rubygems/custom_require.rb:35:in
require' /opt/rh/ruby193/root/usr/share/gems/gems/activesupport-3.2.8/lib/active_support/dependencies.rb:251:in
block in require'
/opt/rh/ruby193/root/usr/share/gems/gems/activesupport-3.2.8/lib/active_support/dependencies.rb:236:in
load_dependency' /opt/rh/ruby193/root/usr/share/gems/gems/activesupport-3.2.8/lib/active_support/dependencies.rb:251:in
require'
/opt/rh/ruby193/root/usr/share/gems/gems/activerecord-3.2.8/lib/active_record/connection_adapters/abstract/connection_specification.rb:50:in
resolve_hash_connection' /opt/rh/ruby193/root/usr/share/gems/gems/activerecord-3.2.8/lib/active_record/connection_adapters/abstract/connection_specification.rb:41:in
resolve_string_connection'
/opt/rh/ruby193/root/usr/share/gems/gems/activerecord-3.2.8/lib/active_record/connection_adapters/abstract/connection_specification.rb:25:in
spec' /opt/rh/ruby193/root/usr/share/gems/gems/activerecord-3.2.8/lib/active_record/connection_adapters/abstract/connection_specification.rb:129:in
establish_connection'
/opt/rh/ruby193/root/usr/share/gems/gems/activerecord-3.2.8/lib/active_record/railtie.rb:82:in
block (2 levels) in <class:Railtie>' /opt/rh/ruby193/root/usr/share/gems/gems/activesupport-3.2.8/lib/active_support/lazy_load_hooks.rb:36:in
instance_eval'
/opt/rh/ruby193/root/usr/share/gems/gems/activesupport-3.2.8/lib/active_support/lazy_load_hooks.rb:36:in
execute_hook' /opt/rh/ruby193/root/usr/share/gems/gems/activesupport-3.2.8/lib/active_support/lazy_load_hooks.rb:26:in
block in on_load'
/opt/rh/ruby193/root/usr/share/gems/gems/activesupport-3.2.8/lib/active_support/lazy_load_hooks.rb:25:in
each' /opt/rh/ruby193/root/usr/share/gems/gems/activesupport-3.2.8/lib/active_support/lazy_load_hooks.rb:25:in
on_load'
/opt/rh/ruby193/root/usr/share/gems/gems/activerecord-3.2.8/lib/active_record/railtie.rb:74:in
block in <class:Railtie>' /opt/rh/ruby193/root/usr/share/gems/gems/railties-3.2.8/lib/rails/initializable.rb:30:in
instance_exec'
/opt/rh/ruby193/root/usr/share/gems/gems/railties-3.2.8/lib/rails/initializable.rb:30:in
run' /opt/rh/ruby193/root/usr/share/gems/gems/railties-3.2.8/lib/rails/initializable.rb:55:in
block in run_initializers'
/opt/rh/ruby193/root/usr/share/gems/gems/railties-3.2.8/lib/rails/initializable.rb:54:in
each' /opt/rh/ruby193/root/usr/share/gems/gems/railties-3.2.8/lib/rails/initializable.rb:54:in
run_initializers'
/opt/rh/ruby193/root/usr/share/gems/gems/railties-3.2.8/lib/rails/application.rb:136:in
initialize!' /opt/rh/ruby193/root/usr/share/gems/gems/railties-3.2.8/lib/rails/railtie/configurable.rb:30:in
method_missing'
/usr/share/foreman/config/environment.rb:5:in <top (required)>' /opt/rh/ruby193/root/usr/share/rubygems/rubygems/custom_require.rb:36:in
require'
/opt/rh/ruby193/root/usr/share/rubygems/rubygems/custom_require.rb:36:in
require' /opt/rh/ruby193/root/usr/share/gems/gems/activesupport-3.2.8/lib/active_support/dependencies.rb:251:in
block in require'
/opt/rh/ruby193/root/usr/share/gems/gems/activesupport-3.2.8/lib/active_support/dependencies.rb:236:in
load_dependency' /opt/rh/ruby193/root/usr/share/gems/gems/activesupport-3.2.8/lib/active_support/dependencies.rb:251:in
require'
/opt/rh/ruby193/root/usr/share/gems/gems/railties-3.2.8/lib/rails/application.rb:103:in
require_environment!' /opt/rh/ruby193/root/usr/share/gems/gems/railties-3.2.8/lib/rails/application.rb:295:in
block (2 levels) in initialize_tasks'
/opt/rh/ruby193/root/usr/share/ruby/rake/task.rb:205:in call' /opt/rh/ruby193/root/usr/share/ruby/rake/task.rb:205:in
block in execute'
/opt/rh/ruby193/root/usr/share/ruby/rake/task.rb:200:in each' /opt/rh/ruby193/root/usr/share/ruby/rake/task.rb:200:in
execute'
/opt/rh/ruby193/root/usr/share/ruby/rake/task.rb:158:in block in invoke_with_call_chain' /opt/rh/ruby193/root/usr/share/ruby/monitor.rb:211:in
mon_synchronize'
/opt/rh/ruby193/root/usr/share/ruby/rake/task.rb:151:in
invoke_with_call_chain' /opt/rh/ruby193/root/usr/share/ruby/rake/task.rb:176:in
block in
invoke_prerequisites'
/opt/rh/ruby193/root/usr/share/ruby/rake/task.rb:174:in each' /opt/rh/ruby193/root/usr/share/ruby/rake/task.rb:174:in
invoke_prerequisites'
/opt/rh/ruby193/root/usr/share/ruby/rake/task.rb:157:in block in invoke_with_call_chain' /opt/rh/ruby193/root/usr/share/ruby/monitor.rb:211:in
mon_synchronize'
/opt/rh/ruby193/root/usr/share/ruby/rake/task.rb:151:in
invoke_with_call_chain' /opt/rh/ruby193/root/usr/share/ruby/rake/task.rb:144:in
invoke'
/opt/rh/ruby193/root/usr/share/ruby/rake/application.rb:116:in invoke_task' /opt/rh/ruby193/root/usr/share/ruby/rake/application.rb:94:in
block (2
levels) in top_level'
/opt/rh/ruby193/root/usr/share/ruby/rake/application.rb:94:in each' /opt/rh/ruby193/root/usr/share/ruby/rake/application.rb:94:in
block in
top_level'
/opt/rh/ruby193/root/usr/share/ruby/rake/application.rb:133:in
standard_exception_handling' /opt/rh/ruby193/root/usr/share/ruby/rake/application.rb:88:in
top_level'
/opt/rh/ruby193/root/usr/share/ruby/rake/application.rb:66:in block in run' /opt/rh/ruby193/root/usr/share/ruby/rake/application.rb:133:in
standard_exception_handling'
/opt/rh/ruby193/root/usr/share/ruby/rake/application.rb:63:in run' /opt/rh/ruby193/root/usr/bin/rake:32:in
<main>'
Tasks: TOP => db:migrate => environment
So this says to me I don't have gem install activerecord-mysql2-adapter or
mysql2 is not ~>0.3.10
gem list
[root@puppet foreman]# gem list
*** LOCAL GEMS ***
activerecord-mysql2-adapter (0.0.3)
daemon_controller (1.1.5)
fastthread (1.0.7)
highline (1.4.0)
json (1.4.6)
mysql (2.9.1)
mysql2 (0.3.13)
passenger (4.0.5)
rack (1.1.0)
rack-test (0.5.4)
rake (0.8.7)
rkerberos (0.1.1)
sinatra (1.0)
I have MariaDB running and installed, puppet DB setup with uid/pwd as puppet
[root@puppet foreman]# mysql -upuppet -ppuppet puppet
Welcome to the MariaDB monitor. Commands end with ; or \g.
Your MariaDB connection id is 12
Server version: 5.5.33a-MariaDB MariaDB Server
Copyright © 2000, 2013, Oracle, Monty Program Ab and others.
Type 'help;' or '\h' for help. Type '\c' to clear the current input
statement.
MariaDB [puppet]>
Tried to install activerecord-mysql-adapter
[root@puppet foreman]# gem install activerecord-mysql-adapter
Building native extensions. This could take a while…
ERROR: Error installing activerecord-mysql-adapter:
activesupport requires Ruby version >= 1.9.3.
[root@puppet foreman]# gem install activerecord-mysql2-adapter
Successfully installed activerecord-mysql2-adapter-0.0.3
1 gem installed
Installing ri documentation for activerecord-mysql2-adapter-0.0.3…
Installing RDoc documentation for activerecord-mysql2-adapter-0.0.3…
Here's /etc/foreman/database.yml (tried both mysql and mysql2)
production:
adapter: mysql2
database: puppet
host: localhost
port: 3306
username: puppet
password: puppet
encoding: utf8
···
-------------------------- So thinking there were issues with the ruby version I did the following: [root@puppet lib64]# /opt/rh/ruby193/root/usr/bin/ruby --version /opt/rh/ruby193/root/usr/bin/ruby: error while loading shared libraries: libruby.so.1.9: cannot open shared object file: No such file or directorycd usr/lib64
cd /usr/lib64
ln -s /opt/rh/ruby193/root/usr/lib64/libruby.so.1.9.1 .
ln -s /opt/rh/ruby193/root/usr/lib64/libruby.so.1.9.1 libruby.so.1.9
cd /usr/bin
mv ruby ruby.1.8
ln -s /opt/rh/ruby193/root/usr/bin/ruby .
gem install activerecord-mysql-adapter
gem install activerecord-mysql2-adapter
[root@puppet foreman]# /usr/bin/ruby --version
ruby 1.9.3p327 (2012-11-10 revision 37606) [x86_64-linux]
[root@puppet foreman]# cd ~foreman && sudo -u foreman scl enable ruby193
’RAILS_ENV=production rake db:migrate’
rake aborted!
undefined method `active_record’ for
#Rails::Application::Configuration:0x00000002996298
(See full trace by running task with --trace)
[root@puppet foreman]# cd ~foreman && sudo -u foreman scl enable ruby193
’RAILS_ENV=production rake db:migrate --trace’
rake aborted!
undefined method active_record' for #<Rails::Application::Configuration:0x0000000248a010> /opt/rh/ruby193/root/usr/share/gems/gems/railties-3.2.8/lib/rails/railtie/configuration.rb:85:in
method_missing’
/usr/share/foreman/config/application.rb:57:in <class:Application>' /usr/share/foreman/config/application.rb:37:in
module:Foreman’
/usr/share/foreman/config/application.rb:36:in <top (required)>' /opt/rh/ruby193/root/usr/share/rubygems/rubygems/custom_require.rb:36:in
require’
/opt/rh/ruby193/root/usr/share/rubygems/rubygems/custom_require.rb:36:in
require' /usr/share/foreman/Rakefile:1:in
<top (required)>’
/opt/rh/ruby193/root/usr/share/ruby/rake/rake_module.rb:25:in load' /opt/rh/ruby193/root/usr/share/ruby/rake/rake_module.rb:25:in
load_rakefile’
/opt/rh/ruby193/root/usr/share/ruby/rake/application.rb:501:in
raw_load_rakefile' /opt/rh/ruby193/root/usr/share/ruby/rake/application.rb:82:in
block in
load_rakefile’
/opt/rh/ruby193/root/usr/share/ruby/rake/application.rb:133:in
standard_exception_handling' /opt/rh/ruby193/root/usr/share/ruby/rake/application.rb:81:in
load_rakefile’
/opt/rh/ruby193/root/usr/share/ruby/rake/application.rb:65:in block in run' /opt/rh/ruby193/root/usr/share/ruby/rake/application.rb:133:in
standard_exception_handling’
/opt/rh/ruby193/root/usr/share/ruby/rake/application.rb:63:in run' /opt/rh/ruby193/root/usr/bin/rake:32:in
’
At this point I’m lost… and frustrated… is it REALLY this hard?! What
am I missing?