Uninitialized CarrierWave constant

I am deploying my first rail application with passenger and capistrano.

everything is fine until I ran into this error when I tried to run the application in a browser.

Error message:
   uninitialized constant CarrierWave

Exception class:
   NameError

You can see the message in detail at http://test.ajhezaty.com/

the site works fine locally, and CarrierWave loads the image correctly.

I tried restarting the VPS server by running

sudo /etc/init.d/httpd2 restart

but the problem persists.

for your information the stone installed on the server

 $ gem list | grep carrierwave
 carrierwave (0.6.1)
+3
source share
2 answers

You need to add the carrier to the application.rb file as follows:

require File.expand_path('../boot', __FILE__)

require 'rails/all'

require 'carrierwave'

if defined?(Bundler)
  # Bundler stuff
end

# Rest of file ommited.

nginx/unicorn. .

+15

gem , , Gemfile, ssh , .

+1

All Articles