简体   繁体   中英

NameError (uninitialized constant Mime::XLS):

I am getting the problem on my Ubuntu server, but it works on my local machine completely without any error.

ruby version 1.9.3

rails version 3.2.13

I have done the following configurations:

application.rb

require File.expand_path('../boot', __FILE__)
require 'csv'
require 'rails/all'

/initializers/mime_types.rb

Mime::Type.register "application/xls", :xls
#Mime::Type.register "application/vnd.ms-excel", :xls

I have got the reference from here

Finally solve the problem

The problem occur because at that time we are running the application on server in daemon mode with it's IP, we didn't bind the application with Phusion Passenger and Apache.

And for that work we were always restart the Apache server and testing the changes but the config folder is always boot with application when we start the server.

I am posting the answer for someone for help if they got same problem.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM