I am getting the following error after deploying my application to my VPS. ActiveAdmin works fine on my local development environment, but once I deploy using capistrano, it looks like the gem is not being installed?
E, [2013-03-14T01:27:04.901577 #24972] ERROR -- : uninitialized constant ActiveAdmin (NameError)
/home/deployer/apps/papaya/releases/20130314052558/config/initializers/active_admin.rb:1:in `<top (required)>'
My gem file
source 'https://rubygems.org'
gem 'rails', '3.2.11'
# Bundle edge Rails instead:
# gem 'rails', :git => 'git://github.com/rails/rails.git'
gem 'pg'
gem 'bootstrap-sass'
gem 'font-awesome-sass-rails'
# gem 'acts_as_tree', :git => 'git://github.com/amerine/acts_as_tree.git'
gem 'closure_tree'
gem 'kaminari'
gem 'friendly_id'
gem 'slim'
gem 'gmaps4rails'
gem 'devise'
gem 'omniauth'
gem 'oauth2'
gem 'omniauth-facebook'
gem 'omniauth-twitter'
gem 'simple_form'
gem 'pg_search'
gem 'stamp'
gem 'acts-as-taggable-on', '~> 2.3.1'
gem 'rmagick'
gem 'carrierwave'
gem 'select2-rails'
# gem 'roo'
gem 'activeadmin'
gem "meta_search", '>= 1.1.0.pre'
# Gems used only for assets and not required
# in production environments by default.
group :assets do
gem 'sass-rails', '~> 3.2.3'
gem 'coffee-rails', '~> 3.2.1'
# See https://github.com/sstephenson/execjs#readme for more supported runtimes
# gem 'therubyracer', :platforms => :ruby
gem 'uglifier', '>= 1.0.3'
gem 'compass-rails'
gem 'turbo-sprockets-rails3'
end
I am able to run the console without a problem and require activeadmin
deployer@pareto:~/apps/papaya/current$ RAILS_ENV=production bundle exec irb
irb(main):001:0> require 'activeadmin'
=> true
irb(main):002:0>
When requiring gems that define constants, like ActiveAdmin
or ActiveAdmin::Comment
, if for some reason during definition of that constant something goes wrong Bundler leaves that constant undefined and won't reraise the exception.
ActiveAdmin
depends on ExecJS
and ExecJS
needs a working JavaScript runtime. ExecJS
will throw an error like this during definition of ActiveAdmin
constant.
ExecJS::RuntimeUnavailable: Could not find a JavaScript runtime. See https://github.com/sstephenson/execjs for a list of available runtimes.
In this case, just install Node.js. sudo apt-get install nodejs
bundle exec rails console
irb
and work through its dependencies.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