Error When Attempting to Run 'rake' Commands after Quickstart Install -- "no such file to load"

Hello!

After installing Foreman using the 'foreman-installer' method on RHEL 6.4,
I am receiving the following error messages when attempting to run 'rake'
commands based on examples given in the manual. This is Foreman 1.2.

I should note that I previously had Puppet and Foreman installed to this
server and configured to work together manually. I've since removed the
relevant patches and config files (I think!) and re-installed via the
'foreman-installer'.

[root@foreman ~]# rake puppet:import:hosts_and_facts RAILS_ENV=production
rake aborted!
No Rakefile found (looking for: rakefile, Rakefile, rakefile.rb,
Rakefile.rb)

(See full trace by running task with --trace)

After seeing the above, I change to '/usr/share/foreman' and try again.
This fails, but for a different reason:

[root@foreman ~]# cd /usr/share/foreman/
[root@foreman foreman]# rake puppet:import:hosts_and_facts
RAILS_ENV=production

rake aborted!
no such file to load – rails/all

(See full trace by running task with --trace)

Here's the full output with '–trace':

[root@foreman foreman]# rake puppet:import:hosts_and_facts
RAILS_ENV=production --trace

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:inrequire'
/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:inrequire'
/usr/share/foreman/Rakefile:1
/usr/lib/ruby/gems/1.8/gems/rake-10.0.3/lib/rake/rake_module.rb:25:in load' /usr/lib/ruby/gems/1.8/gems/rake-10.0.3/lib/rake/rake_module.rb:25:inload_rakefile'
/usr/lib/ruby/gems/1.8/gems/rake-10.0.3/lib/rake/application.rb:583:in
raw_load_rakefile' /usr/lib/ruby/gems/1.8/gems/rake-10.0.3/lib/rake/application.rb:89:inload_rakefile'
/usr/lib/ruby/gems/1.8/gems/rake-10.0.3/lib/rake/application.rb:160:in
standard_exception_handling' /usr/lib/ruby/gems/1.8/gems/rake-10.0.3/lib/rake/application.rb:88:inload_rakefile'
/usr/lib/ruby/gems/1.8/gems/rake-10.0.3/lib/rake/application.rb:72:in run' /usr/lib/ruby/gems/1.8/gems/rake-10.0.3/lib/rake/application.rb:160:instandard_exception_handling'
/usr/lib/ruby/gems/1.8/gems/rake-10.0.3/lib/rake/application.rb:70:in run' /usr/lib/ruby/gems/1.8/gems/rake-10.0.3/bin/rake:33 /usr/bin/rake:19:inload'
/usr/bin/rake:19

Any assistance is greatly needed and appreciated.

Thanks!
– Adam

This was changed in Foreman 1.2 on EL due to a few packaging
differences. Instead, you'll usually run (EL only):

cd ~foreman && sudo -u foreman scl enable ruby193 'RAILS_ENV=production
rake puppet:import:hosts_and_facts'

It's obviously getting rather lengthy, so we're adding a "foreman-rake"
in 1.3 to cut down on typing and differences between each of our
supported distros.

··· -- Dominic Cleal Red Hat Engineering

On 26/07/13 13:42, J. Adam Craig wrote:

Hello!

After installing Foreman using the ‘foreman-installer’ method on RHEL
6.4, I am receiving the following error messages when attempting to run
’rake’ commands based on examples given in the manual. This is Foreman 1.2.

I should note that I previously had Puppet and Foreman installed to this
server and configured to work together manually. I’ve since removed the
relevant patches and config files (I think!) and re-installed via the
’foreman-installer’.

[root@foreman ~]# rake puppet:import:hosts_and_facts RAILS_ENV=production
rake aborted!
No Rakefile found (looking for: rakefile, Rakefile, rakefile.rb,
Rakefile.rb)

(See full trace by running task with --trace)

After seeing the above, I change to ‘/usr/share/foreman’ and try again.
This fails, but for a different reason:

[root@foreman ~]# cd /usr/share/foreman/
[root@foreman foreman]# rake puppet:import:hosts_and_facts
RAILS_ENV=production

rake aborted!
no such file to load – rails/all

(See full trace by running task with --trace)

Here’s the full output with ‘–trace’:

[root@foreman foreman]# rake puppet:import:hosts_and_facts
RAILS_ENV=production --trace

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:inrequire’
/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:inrequire’
/usr/share/foreman/Rakefile:1
/usr/lib/ruby/gems/1.8/gems/rake-10.0.3/lib/rake/rake_module.rb:25:in load' /usr/lib/ruby/gems/1.8/gems/rake-10.0.3/lib/rake/rake_module.rb:25:inload_rakefile’
/usr/lib/ruby/gems/1.8/gems/rake-10.0.3/lib/rake/application.rb:583:in
raw_load_rakefile' /usr/lib/ruby/gems/1.8/gems/rake-10.0.3/lib/rake/application.rb:89:inload_rakefile’
/usr/lib/ruby/gems/1.8/gems/rake-10.0.3/lib/rake/application.rb:160:in
standard_exception_handling' /usr/lib/ruby/gems/1.8/gems/rake-10.0.3/lib/rake/application.rb:88:inload_rakefile’
/usr/lib/ruby/gems/1.8/gems/rake-10.0.3/lib/rake/application.rb:72:in run' /usr/lib/ruby/gems/1.8/gems/rake-10.0.3/lib/rake/application.rb:160:instandard_exception_handling’
/usr/lib/ruby/gems/1.8/gems/rake-10.0.3/lib/rake/application.rb:70:in run' /usr/lib/ruby/gems/1.8/gems/rake-10.0.3/bin/rake:33 /usr/bin/rake:19:inload’
/usr/bin/rake:19

Any assistance is greatly needed and appreciated.

Thanks!
– Adam


You received this message because you are subscribed to the Google
Groups “Foreman users” group.
To unsubscribe from this group and stop receiving emails from it, send
an email to foreman-users+unsubscribe@googlegroups.com.
To post to this group, send email to foreman-users@googlegroups.com.
Visit this group at http://groups.google.com/group/foreman-users.
For more options, visit https://groups.google.com/groups/opt_out.

Thanks, Dominic!

That seems to work! However, now I see a dependency error indicating that
I need to install a gem, 'activerecord-sqlite3-adapter'. The suggested
command produces the following error:

[root@foreman foreman]# gem install activerecord-sqlite3-adapter
ERROR: Could not find a valid gem 'activerecord-sqlite3-adapter' (>= 0) in
any repository

Best,
– Adam

··· On Friday, July 26, 2013 8:45:25 AM UTC-4, Dominic Cleal wrote: > > This was changed in Foreman 1.2 on EL due to a few packaging > differences. Instead, you'll usually run (EL only): > > cd ~foreman && sudo -u foreman scl enable ruby193 'RAILS_ENV=production > rake puppet:import:hosts_and_facts' > > It's obviously getting rather lengthy, so we're adding a "foreman-rake" > in 1.3 to cut down on typing and differences between each of our > supported distros. > > -- > Dominic Cleal > Red Hat Engineering > > On 26/07/13 13:42, J. Adam Craig wrote: > > Hello! > > > > After installing Foreman using the 'foreman-installer' method on RHEL > > 6.4, I am receiving the following error messages when attempting to run > > 'rake' commands based on examples given in the manual. This is Foreman > 1.2. > > > > I should note that I previously had Puppet and Foreman installed to this > > server and configured to work together manually. I've since removed the > > relevant patches and config files (I think!) and re-installed via the > > 'foreman-installer'. > > > > [root@foreman ~]# *rake puppet:import:hosts_and_facts > RAILS_ENV=production* > > rake aborted! > > No Rakefile found (looking for: rakefile, Rakefile, rakefile.rb, > > Rakefile.rb) > > > > (See full trace by running task with --trace) > > > > After seeing the above, I change to '/usr/share/foreman' and try again. > > This fails, but for a different reason: > > > > [root@foreman ~]# *cd /usr/share/foreman/* > > [root@foreman foreman]# *rake puppet:import:hosts_and_facts > > RAILS_ENV=production* > > rake aborted! > > no such file to load -- rails/all > > > > (See full trace by running task with --trace) > > > > Here's the full output with '--trace': > > > > [root@foreman foreman]# *rake puppet:import:hosts_and_facts > > RAILS_ENV=production --trace* > > 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-10.0.3/lib/rake/rake_module.rb:25:in > `load' > > /usr/lib/ruby/gems/1.8/gems/rake-10.0.3/lib/rake/rake_module.rb:25:in > > `load_rakefile' > > /usr/lib/ruby/gems/1.8/gems/rake-10.0.3/lib/rake/application.rb:583:in > > `raw_load_rakefile' > > /usr/lib/ruby/gems/1.8/gems/rake-10.0.3/lib/rake/application.rb:89:in > > `load_rakefile' > > /usr/lib/ruby/gems/1.8/gems/rake-10.0.3/lib/rake/application.rb:160:in > > `standard_exception_handling' > > /usr/lib/ruby/gems/1.8/gems/rake-10.0.3/lib/rake/application.rb:88:in > > `load_rakefile' > > /usr/lib/ruby/gems/1.8/gems/rake-10.0.3/lib/rake/application.rb:72:in > `run' > > /usr/lib/ruby/gems/1.8/gems/rake-10.0.3/lib/rake/application.rb:160:in > > `standard_exception_handling' > > /usr/lib/ruby/gems/1.8/gems/rake-10.0.3/lib/rake/application.rb:70:in > `run' > > /usr/lib/ruby/gems/1.8/gems/rake-10.0.3/bin/rake:33 > > /usr/bin/rake:19:in `load' > > /usr/bin/rake:19 > > > > Any assistance is greatly needed and appreciated. > > > > Thanks! > > -- Adam > > > > -- > > You received this message because you are subscribed to the Google > > Groups "Foreman users" group. > > To unsubscribe from this group and stop receiving emails from it, send > > an email to foreman-user...@googlegroups.com . > > To post to this group, send email to forema...@googlegroups.com. > > > Visit this group at http://groups.google.com/group/foreman-users. > > For more options, visit https://groups.google.com/groups/opt_out. > > > > > >

That suggests it's missing the RAILS_ENV=production and is defaulting to
the "development" environment (which'll be configured with SQLite).

Check you have RAILS_ENV specified either at the start of the rake
command (as an environment variable) or as one of the arguments.

I forgot to mention that ruby193-rake is a shortcut to "scl enable
ruby193 'rake…'".

··· -- Dominic Cleal Red Hat Engineering

On 26/07/13 13:54, J. Adam Craig wrote:

Thanks, Dominic!

That seems to work! However, now I see a dependency error indicating
that I need to install a gem, ‘activerecord-sqlite3-adapter’. The
suggested command produces the following error:

[root@foreman foreman]# gem install activerecord-sqlite3-adapter
ERROR: Could not find a valid gem ‘activerecord-sqlite3-adapter’ (>= 0)
in any repository

Best,
– Adam

On Friday, July 26, 2013 8:45:25 AM UTC-4, Dominic Cleal wrote:

This was changed in Foreman 1.2 on EL due to a few packaging
differences.  Instead, you'll usually run (EL only):

cd ~foreman && sudo -u foreman scl enable ruby193 'RAILS_ENV=production
rake puppet:import:hosts_and_facts'

It's obviously getting rather lengthy, so we're adding a "foreman-rake"
in 1.3 to cut down on typing and differences between each of our
supported distros.

-- 
Dominic Cleal
Red Hat Engineering

On 26/07/13 13:42, J. Adam Craig wrote:
> Hello!
>
> After installing Foreman using the 'foreman-installer' method on RHEL
> 6.4, I am receiving the following error messages when attempting
to run
> 'rake' commands based on examples given in the manual.  This is
Foreman 1.2.
>
> I should note that I previously had Puppet and Foreman installed
to this
> server and configured to work together manually.  I've since
removed the
> relevant patches and config files (I think!) and re-installed via the
> 'foreman-installer'.
>
> [root@foreman ~]# *rake puppet:import:hosts_and_facts
RAILS_ENV=production*
> rake aborted!
> No Rakefile found (looking for: rakefile, Rakefile, rakefile.rb,
> Rakefile.rb)
>
> (See full trace by running task with --trace)
>
> After seeing the above, I change to '/usr/share/foreman' and try
again.
> This fails, but for a different reason:
>
> [root@foreman ~]# *cd /usr/share/foreman/*
> [root@foreman foreman]# *rake puppet:import:hosts_and_facts
> RAILS_ENV=production*
> rake aborted!
> no such file to load -- rails/all
>
> (See full trace by running task with --trace)
>
> Here's the full output with '--trace':
>
> [root@foreman foreman]# *rake puppet:import:hosts_and_facts
> RAILS_ENV=production --trace*
> 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-10.0.3/lib/rake/rake_module.rb:25:in `load'

> /usr/lib/ruby/gems/1.8/gems/rake-10.0.3/lib/rake/rake_module.rb:25:in
> `load_rakefile'
>
/usr/lib/ruby/gems/1.8/gems/rake-10.0.3/lib/rake/application.rb:583:in
> `raw_load_rakefile'
> /usr/lib/ruby/gems/1.8/gems/rake-10.0.3/lib/rake/application.rb:89:in
> `load_rakefile'
>
/usr/lib/ruby/gems/1.8/gems/rake-10.0.3/lib/rake/application.rb:160:in
> `standard_exception_handling'
> /usr/lib/ruby/gems/1.8/gems/rake-10.0.3/lib/rake/application.rb:88:in
> `load_rakefile'
>
/usr/lib/ruby/gems/1.8/gems/rake-10.0.3/lib/rake/application.rb:72:in `run'

>
/usr/lib/ruby/gems/1.8/gems/rake-10.0.3/lib/rake/application.rb:160:in
> `standard_exception_handling'
>
/usr/lib/ruby/gems/1.8/gems/rake-10.0.3/lib/rake/application.rb:70:in `run'

> /usr/lib/ruby/gems/1.8/gems/rake-10.0.3/bin/rake:33
> /usr/bin/rake:19:in `load'
> /usr/bin/rake:19
>
> Any assistance is greatly needed and appreciated.
>
> Thanks!
> -- Adam
>
> --
> You received this message because you are subscribed to the Google
> Groups "Foreman users" group.
> To unsubscribe from this group and stop receiving emails from it,
send
> an email to foreman-user...@googlegroups.com <javascript:>.
> To post to this group, send email to forema...@googlegroups.com
<javascript:>.
> Visit this group at http://groups.google.com/group/foreman-users
<http://groups.google.com/group/foreman-users>.
> For more options, visit https://groups.google.com/groups/opt_out
<https://groups.google.com/groups/opt_out>.
>  
>  


You received this message because you are subscribed to the Google
Groups “Foreman users” group.
To unsubscribe from this group and stop receiving emails from it, send
an email to foreman-users+unsubscribe@googlegroups.com.
To post to this group, send email to foreman-users@googlegroups.com.
Visit this group at http://groups.google.com/group/foreman-users.
For more options, visit https://groups.google.com/groups/opt_out.

Thanks! Yes, I messed up when pasting the command you provided, and my
terminal separated it out across multiple lines, which caused the RAILS_ENV
issue you detected.

'Preciate the 'ruby193-rake' shortcut – that's much simpler!

– Adam

··· ______________________ *J. Adam Craig* UNIX Operating Systems Analyst VCU Computer Center 804.828.4886

“Don’t be a phishing victim – VCU and other reputable organizations will
never use email to request that you reply with your password, social
security number or confidential personal information. For more detauls,
visit http://infosecurity.vcu.edu/phishing.html

On Fri, Jul 26, 2013 at 9:00 AM, Dominic Cleal dcleal@redhat.com wrote:

That suggests it’s missing the RAILS_ENV=production and is defaulting to
the “development” environment (which’ll be configured with SQLite).

Check you have RAILS_ENV specified either at the start of the rake
command (as an environment variable) or as one of the arguments.

I forgot to mention that ruby193-rake is a shortcut to “scl enable
ruby193 ‘rake…’”.


Dominic Cleal
Red Hat Engineering

On 26/07/13 13:54, J. Adam Craig wrote:

Thanks, Dominic!

That seems to work! However, now I see a dependency error indicating
that I need to install a gem, ‘activerecord-sqlite3-adapter’. The
suggested command produces the following error:

[root@foreman foreman]# gem install activerecord-sqlite3-adapter
ERROR: Could not find a valid gem ‘activerecord-sqlite3-adapter’ (>= 0)
in any repository

Best,
– Adam

On Friday, July 26, 2013 8:45:25 AM UTC-4, Dominic Cleal wrote:

This was changed in Foreman 1.2 on EL due to a few packaging
differences.  Instead, you'll usually run (EL only):

cd ~foreman && sudo -u foreman scl enable ruby193

'RAILS_ENV=production

rake puppet:import:hosts_and_facts'

It's obviously getting rather lengthy, so we're adding a

“foreman-rake”

in 1.3 to cut down on typing and differences between each of our
supported distros.

--
Dominic Cleal
Red Hat Engineering

On 26/07/13 13:42, J. Adam Craig wrote:
> Hello!
>
> After installing Foreman using the 'foreman-installer' method on

RHEL

> 6.4, I am receiving the following error messages when attempting
to run
> 'rake' commands based on examples given in the manual.  This is
Foreman 1.2.
>
> I should note that I previously had Puppet and Foreman installed
to this
> server and configured to work together manually.  I've since
removed the
> relevant patches and config files (I think!) and re-installed via

the

> 'foreman-installer'.
>
> [root@foreman ~]# *rake puppet:import:hosts_and_facts
RAILS_ENV=production*
> rake aborted!
> No Rakefile found (looking for: rakefile, Rakefile, rakefile.rb,
> Rakefile.rb)
>
> (See full trace by running task with --trace)
>
> After seeing the above, I change to '/usr/share/foreman' and try
again.
> This fails, but for a different reason:
>
> [root@foreman ~]# *cd /usr/share/foreman/*
> [root@foreman foreman]# *rake puppet:import:hosts_and_facts
> RAILS_ENV=production*
> rake aborted!
> no such file to load -- rails/all
>
> (See full trace by running task with --trace)
>
> Here's the full output with '--trace':
>
> [root@foreman foreman]# *rake puppet:import:hosts_and_facts
> RAILS_ENV=production --trace*
> 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-10.0.3/lib/rake/rake_module.rb:25:in `load’

>

/usr/lib/ruby/gems/1.8/gems/rake-10.0.3/lib/rake/rake_module.rb:25:in

> `load_rakefile'
>

/usr/lib/ruby/gems/1.8/gems/rake-10.0.3/lib/rake/application.rb:583:in

> `raw_load_rakefile'
>

/usr/lib/ruby/gems/1.8/gems/rake-10.0.3/lib/rake/application.rb:89:in

> `load_rakefile'
>

/usr/lib/ruby/gems/1.8/gems/rake-10.0.3/lib/rake/application.rb:160:in

> `standard_exception_handling'
>

/usr/lib/ruby/gems/1.8/gems/rake-10.0.3/lib/rake/application.rb:88:in

> `load_rakefile'
>

/usr/lib/ruby/gems/1.8/gems/rake-10.0.3/lib/rake/application.rb:72:in `run’

>

/usr/lib/ruby/gems/1.8/gems/rake-10.0.3/lib/rake/application.rb:160:in

> `standard_exception_handling'
>

/usr/lib/ruby/gems/1.8/gems/rake-10.0.3/lib/rake/application.rb:70:in `run’

> /usr/lib/ruby/gems/1.8/gems/rake-10.0.3/bin/rake:33
> /usr/bin/rake:19:in `load'
> /usr/bin/rake:19
>
> Any assistance is greatly needed and appreciated.
>
> Thanks!
> -- Adam
>
> --
> You received this message because you are subscribed to the Google
> Groups "Foreman users" group.
> To unsubscribe from this group and stop receiving emails from it,
send
> an email to foreman-user...@googlegroups.com <javascript:>.
> To post to this group, send email to forema...@googlegroups.com
<javascript:>.
> Visit this group at http://groups.google.com/group/foreman-users
<http://groups.google.com/group/foreman-users>.
> For more options, visit https://groups.google.com/groups/opt_out
<https://groups.google.com/groups/opt_out>.
>
>


You received this message because you are subscribed to the Google
Groups “Foreman users” group.
To unsubscribe from this group and stop receiving emails from it, send
an email to foreman-users+unsubscribe@googlegroups.com.
To post to this group, send email to foreman-users@googlegroups.com.
Visit this group at http://groups.google.com/group/foreman-users.
For more options, visit https://groups.google.com/groups/opt_out.


You received this message because you are subscribed to the Google Groups
"Foreman users" group.
To unsubscribe from this group and stop receiving emails from it, send an
email to foreman-users+unsubscribe@googlegroups.com.
To post to this group, send email to foreman-users@googlegroups.com.
Visit this group at http://groups.google.com/group/foreman-users.
For more options, visit https://groups.google.com/groups/opt_out.

As an aside – I've added the following line to my '~/.bashrc' file, which
adds an alias to cut down on additional typing, and allows the user to
follow the commands outlined in the manual without needing to adapt for EL
distros:

alias rake='cd ~foreman && sudo -u foreman ruby193-rake '

– Adam

··· ______________________ *J. Adam Craig* UNIX Operating Systems Analyst VCU Computer Center 804.828.4886

“Don’t be a phishing victim – VCU and other reputable organizations will
never use email to request that you reply with your password, social
security number or confidential personal information. For more detauls,
visit http://infosecurity.vcu.edu/phishing.html

On Fri, Jul 26, 2013 at 9:08 AM, J. Adam Craig jacraig@vcu.edu wrote:

Thanks! Yes, I messed up when pasting the command you provided, and my
terminal separated it out across multiple lines, which caused the RAILS_ENV
issue you detected.

'Preciate the ‘ruby193-rake’ shortcut – that’s much simpler!

– Adam


J. Adam Craig
UNIX Operating Systems Analyst
VCU Computer Center
804.828.4886

“Don’t be a phishing victim – VCU and other reputable organizations will
never use email to request that you reply with your password, social
security number or confidential personal information. For more detauls,
visit http://infosecurity.vcu.edu/phishing.html

On Fri, Jul 26, 2013 at 9:00 AM, Dominic Cleal dcleal@redhat.com wrote:

That suggests it’s missing the RAILS_ENV=production and is defaulting to
the “development” environment (which’ll be configured with SQLite).

Check you have RAILS_ENV specified either at the start of the rake
command (as an environment variable) or as one of the arguments.

I forgot to mention that ruby193-rake is a shortcut to “scl enable
ruby193 ‘rake…’”.


Dominic Cleal
Red Hat Engineering

On 26/07/13 13:54, J. Adam Craig wrote:

Thanks, Dominic!

That seems to work! However, now I see a dependency error indicating
that I need to install a gem, ‘activerecord-sqlite3-adapter’. The
suggested command produces the following error:

[root@foreman foreman]# gem install activerecord-sqlite3-adapter
ERROR: Could not find a valid gem ‘activerecord-sqlite3-adapter’ (>= 0)
in any repository

Best,
– Adam

On Friday, July 26, 2013 8:45:25 AM UTC-4, Dominic Cleal wrote:

This was changed in Foreman 1.2 on EL due to a few packaging
differences.  Instead, you'll usually run (EL only):

cd ~foreman && sudo -u foreman scl enable ruby193

'RAILS_ENV=production

rake puppet:import:hosts_and_facts'

It's obviously getting rather lengthy, so we're adding a

“foreman-rake”

in 1.3 to cut down on typing and differences between each of our
supported distros.

--
Dominic Cleal
Red Hat Engineering

On 26/07/13 13:42, J. Adam Craig wrote:
> Hello!
>
> After installing Foreman using the 'foreman-installer' method on

RHEL

> 6.4, I am receiving the following error messages when attempting
to run
> 'rake' commands based on examples given in the manual.  This is
Foreman 1.2.
>
> I should note that I previously had Puppet and Foreman installed
to this
> server and configured to work together manually.  I've since
removed the
> relevant patches and config files (I think!) and re-installed via

the

> 'foreman-installer'.
>
> [root@foreman ~]# *rake puppet:import:hosts_and_facts
RAILS_ENV=production*
> rake aborted!
> No Rakefile found (looking for: rakefile, Rakefile, rakefile.rb,
> Rakefile.rb)
>
> (See full trace by running task with --trace)
>
> After seeing the above, I change to '/usr/share/foreman' and try
again.
> This fails, but for a different reason:
>
> [root@foreman ~]# *cd /usr/share/foreman/*
> [root@foreman foreman]# *rake puppet:import:hosts_and_facts
> RAILS_ENV=production*
> rake aborted!
> no such file to load -- rails/all
>
> (See full trace by running task with --trace)
>
> Here's the full output with '--trace':
>
> [root@foreman foreman]# *rake puppet:import:hosts_and_facts
> RAILS_ENV=production --trace*
> 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-10.0.3/lib/rake/rake_module.rb:25:in `load’

>

/usr/lib/ruby/gems/1.8/gems/rake-10.0.3/lib/rake/rake_module.rb:25:in

> `load_rakefile'
>

/usr/lib/ruby/gems/1.8/gems/rake-10.0.3/lib/rake/application.rb:583:in

> `raw_load_rakefile'
>

/usr/lib/ruby/gems/1.8/gems/rake-10.0.3/lib/rake/application.rb:89:in

> `load_rakefile'
>

/usr/lib/ruby/gems/1.8/gems/rake-10.0.3/lib/rake/application.rb:160:in

> `standard_exception_handling'
>

/usr/lib/ruby/gems/1.8/gems/rake-10.0.3/lib/rake/application.rb:88:in

> `load_rakefile'
>

/usr/lib/ruby/gems/1.8/gems/rake-10.0.3/lib/rake/application.rb:72:in `run’

>

/usr/lib/ruby/gems/1.8/gems/rake-10.0.3/lib/rake/application.rb:160:in

> `standard_exception_handling'
>

/usr/lib/ruby/gems/1.8/gems/rake-10.0.3/lib/rake/application.rb:70:in `run’

> /usr/lib/ruby/gems/1.8/gems/rake-10.0.3/bin/rake:33
> /usr/bin/rake:19:in `load'
> /usr/bin/rake:19
>
> Any assistance is greatly needed and appreciated.
>
> Thanks!
> -- Adam
>
> --
> You received this message because you are subscribed to the Google
> Groups "Foreman users" group.
> To unsubscribe from this group and stop receiving emails from it,
send
> an email to foreman-user...@googlegroups.com <javascript:>.
> To post to this group, send email to forema...@googlegroups.com
<javascript:>.
> Visit this group at http://groups.google.com/group/foreman-users
<http://groups.google.com/group/foreman-users>.
> For more options, visit https://groups.google.com/groups/opt_out
<https://groups.google.com/groups/opt_out>.
>
>


You received this message because you are subscribed to the Google
Groups “Foreman users” group.
To unsubscribe from this group and stop receiving emails from it, send
an email to foreman-users+unsubscribe@googlegroups.com.
To post to this group, send email to foreman-users@googlegroups.com.
Visit this group at http://groups.google.com/group/foreman-users.
For more options, visit https://groups.google.com/groups/opt_out.


You received this message because you are subscribed to the Google Groups
"Foreman users" group.
To unsubscribe from this group and stop receiving emails from it, send an
email to foreman-users+unsubscribe@googlegroups.com.
To post to this group, send email to foreman-users@googlegroups.com.
Visit this group at http://groups.google.com/group/foreman-users.
For more options, visit https://groups.google.com/groups/opt_out.

Thanks so much for this! I've spent a few hours trying to figure this out.
Couldn't for the life of me figure out why running the commands on the docs
page didn't work. This did the trick!!

··· On Friday, July 26, 2013 9:22:27 AM UTC-4, J. Adam Craig wrote: > > As an aside -- I've added the following line to my '~/.bashrc' file, which > adds an alias to cut down on additional typing, and allows the user to > follow the commands outlined in the manual without needing to adapt for EL > distros: > > alias rake='cd ~foreman && sudo -u foreman ruby193-rake ' > > > -- Adam > > ______________________ > *J. Adam Craig* > UNIX Operating Systems Analyst > VCU Computer Center > 804.828.4886 > > "Don't be a phishing victim -- VCU and other reputable organizations will > never use email to request that you reply with your password, social > security number or confidential personal information. For more detauls, > visit http://infosecurity.vcu.edu/phishing.html" > > > On Fri, Jul 26, 2013 at 9:08 AM, J. Adam Craig <jac...@vcu.edu > > wrote: > >> Thanks! Yes, I messed up when pasting the command you provided, and my >> terminal separated it out across multiple lines, which caused the RAILS_ENV >> issue you detected. >> >> 'Preciate the 'ruby193-rake' shortcut -- that's much simpler! >> >> -- Adam >> >> ______________________ >> *J. Adam Craig* >> UNIX Operating Systems Analyst >> VCU Computer Center >> 804.828.4886 >> >> "Don't be a phishing victim -- VCU and other reputable organizations will >> never use email to request that you reply with your password, social >> security number or confidential personal information. For more detauls, >> visit http://infosecurity.vcu.edu/phishing.html" >> >> >> On Fri, Jul 26, 2013 at 9:00 AM, Dominic Cleal <dcl...@redhat.com >> > wrote: >> >>> That suggests it's missing the RAILS_ENV=production and is defaulting to >>> the "development" environment (which'll be configured with SQLite). >>> >>> Check you have RAILS_ENV specified either at the start of the rake >>> command (as an environment variable) or as one of the arguments. >>> >>> I forgot to mention that ruby193-rake is a shortcut to "scl enable >>> ruby193 'rake..'". >>> >>> -- >>> Dominic Cleal >>> Red Hat Engineering >>> >>> On 26/07/13 13:54, J. Adam Craig wrote: >>> > Thanks, Dominic! >>> > >>> > That seems to work! However, now I see a dependency error indicating >>> > that I need to install a gem, 'activerecord-sqlite3-adapter'. The >>> > suggested command produces the following error: >>> > >>> > [root@foreman foreman]# *gem install activerecord-sqlite3-adapter* >>> > ERROR: Could not find a valid gem 'activerecord-sqlite3-adapter' (>= >>> 0) >>> > in any repository >>> > >>> > Best, >>> > -- Adam >>> > >>> > On Friday, July 26, 2013 8:45:25 AM UTC-4, Dominic Cleal wrote: >>> > >>> > This was changed in Foreman 1.2 on EL due to a few packaging >>> > differences. Instead, you'll usually run (EL only): >>> > >>> > cd ~foreman && sudo -u foreman scl enable ruby193 >>> 'RAILS_ENV=production >>> > rake puppet:import:hosts_and_facts' >>> > >>> > It's obviously getting rather lengthy, so we're adding a >>> "foreman-rake" >>> > in 1.3 to cut down on typing and differences between each of our >>> > supported distros. >>> > >>> > -- >>> > Dominic Cleal >>> > Red Hat Engineering >>> > >>> > On 26/07/13 13:42, J. Adam Craig wrote: >>> > > Hello! >>> > > >>> > > After installing Foreman using the 'foreman-installer' method on >>> RHEL >>> > > 6.4, I am receiving the following error messages when attempting >>> > to run >>> > > 'rake' commands based on examples given in the manual. This is >>> > Foreman 1.2. >>> > > >>> > > I should note that I previously had Puppet and Foreman installed >>> > to this >>> > > server and configured to work together manually. I've since >>> > removed the >>> > > relevant patches and config files (I think!) and re-installed >>> via the >>> > > 'foreman-installer'. >>> > > >>> > > [root@foreman ~]# *rake puppet:import:hosts_and_facts >>> > RAILS_ENV=production* >>> > > rake aborted! >>> > > No Rakefile found (looking for: rakefile, Rakefile, rakefile.rb, >>> > > Rakefile.rb) >>> > > >>> > > (See full trace by running task with --trace) >>> > > >>> > > After seeing the above, I change to '/usr/share/foreman' and try >>> > again. >>> > > This fails, but for a different reason: >>> > > >>> > > [root@foreman ~]# *cd /usr/share/foreman/* >>> > > [root@foreman foreman]# *rake puppet:import:hosts_and_facts >>> > > RAILS_ENV=production* >>> > > rake aborted! >>> > > no such file to load -- rails/all >>> > > >>> > > (See full trace by running task with --trace) >>> > > >>> > > Here's the full output with '--trace': >>> > > >>> > > [root@foreman foreman]# *rake puppet:import:hosts_and_facts >>> > > RAILS_ENV=production --trace* >>> > > 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-10.0.3/lib/rake/rake_module.rb:25:in `load' >>> > >>> > > >>> /usr/lib/ruby/gems/1.8/gems/rake-10.0.3/lib/rake/rake_module.rb:25:in >>> > > `load_rakefile' >>> > > >>> > >>> /usr/lib/ruby/gems/1.8/gems/rake-10.0.3/lib/rake/application.rb:583:in >>> > > `raw_load_rakefile' >>> > > >>> /usr/lib/ruby/gems/1.8/gems/rake-10.0.3/lib/rake/application.rb:89:in >>> > > `load_rakefile' >>> > > >>> > >>> /usr/lib/ruby/gems/1.8/gems/rake-10.0.3/lib/rake/application.rb:160:in >>> > > `standard_exception_handling' >>> > > >>> /usr/lib/ruby/gems/1.8/gems/rake-10.0.3/lib/rake/application.rb:88:in >>> > > `load_rakefile' >>> > > >>> > >>> /usr/lib/ruby/gems/1.8/gems/rake-10.0.3/lib/rake/application.rb:72:in `run' >>> > >>> > > >>> > >>> /usr/lib/ruby/gems/1.8/gems/rake-10.0.3/lib/rake/application.rb:160:in >>> > > `standard_exception_handling' >>> > > >>> > >>> /usr/lib/ruby/gems/1.8/gems/rake-10.0.3/lib/rake/application.rb:70:in `run' >>> > >>> > > /usr/lib/ruby/gems/1.8/gems/rake-10.0.3/bin/rake:33 >>> > > /usr/bin/rake:19:in `load' >>> > > /usr/bin/rake:19 >>> > > >>> > > Any assistance is greatly needed and appreciated. >>> > > >>> > > Thanks! >>> > > -- Adam >>> > > >>> > > -- >>> > > You received this message because you are subscribed to the >>> Google >>> > > Groups "Foreman users" group. >>> > > To unsubscribe from this group and stop receiving emails from it, >>> > send >>> > > an email to foreman-user...@googlegroups.com . >>> > > To post to this group, send email to forema...@googlegroups.com >>> > . >>> > > Visit this group at http://groups.google.com/group/foreman-users >>> > . >>> > > For more options, visit https://groups.google.com/groups/opt_out >>> > . >>> > > >>> > > >>> > >>> > -- >>> > You received this message because you are subscribed to the Google >>> > Groups "Foreman users" group. >>> > To unsubscribe from this group and stop receiving emails from it, send >>> > an email to foreman-user...@googlegroups.com . >>> > To post to this group, send email to forema...@googlegroups.com >>> . >>> > Visit this group at http://groups.google.com/group/foreman-users. >>> > For more options, visit https://groups.google.com/groups/opt_out. >>> > >>> > >>> >>> -- >>> You received this message because you are subscribed to the Google >>> Groups "Foreman users" group. >>> To unsubscribe from this group and stop receiving emails from it, send >>> an email to foreman-user...@googlegroups.com . >>> To post to this group, send email to forema...@googlegroups.com >>> . >>> Visit this group at http://groups.google.com/group/foreman-users. >>> For more options, visit https://groups.google.com/groups/opt_out. >>> >>> >>> >> >