When I try any of the rails, rake command in staging server I got no such file to load -- ap (LoadError),
for rails s:
/usr/local/lib/ruby/gems/1.8/gems/bundler-1.0.22/lib/bundler/runtime.rb:68:in`require': no such file to load -- ap (LoadError)    
 xxxx    
/config/application.rb:7
for rake -T:
rake aborted!
no such file to load -- ap
my application.rb file:
require File.expand_path('../boot', __FILE__)
require 'rails/all'
# If you have a Gemfile, require the gems listed there, including any gems
# you've limited to :test, :development, or :production. 
Bundler.require(:default, Rails.env) if defined?(Bundler)
my rails and ruby version:
But I can run rails s, rails c, rake log:clear everything in my local machine. Gemfile file in staging is same as Gemfile in local.
what am I missing here? how can I resolve this?
In your Gemfile, change this line:
gem "awesome_print", :require => "ap" 
...to this:
gem "awesome_print"
I just had the same thing happen to me.  ap is a custom defined alias for awesome_print.  This allows you to do things like ap Product.first and it will pretty print it for you.  Much easier than typing out awesome_print Product.first
I'm not sure why, but when this happened to me, I dropped the alias, and it loaded without an issue. There is probably something else in play here that someone smarter than myself can explain, but I know that this worked for me.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With