Problem Launching a RoR Application in a Production Environment

For an application that has โ€œlists,โ€ consider ads, and each listing has a list of tags.

The following code does not work when I run the application in production mode, but works fine in development mode

uninitialized constant ActiveRecord::Acts::Taggable::InstanceMethods::TagList Extracted source (around line #45): 42: 43: <span class="listingIndexTags"> 44: Location: [location] | Tags: 45: <% tag_list = listing.tag_list %> 46: <% if tag_list != nil %> 47: <% for tag in tag_list %> 48: <%= link_to tag.to_s, { :action => "filter_on", 

The command line that I use to start the mongrel instance in this test case is: ruby โ€‹โ€‹script / server mongrel -e production

The default port is 3000. I can access other views in the application that DO NOT FIND "listing.tag_list".

". tag_list" is provided by the "act_as_taggable_on_steroids" that I use in this application. It is set like a gem.

Perhaps my environment files are inconvenient?

Here is my development.rb file

 config.cache_classes = false config.whiny_nils = true config.action_controller.consider_all_requests_local = true config.action_view.debug_rjs = true config.action_controller.perform_caching = false config.action_mailer.raise_delivery_errors = true config.action_mailer.delivery_method = :smtp config.action_mailer.smtp_settings = { ...took these settings out for this post... } 

And my production.rb file ...

 config.cache_classes = true config.threadsafe! config.action_controller.consider_all_requests_local = false config.action_controller.perform_caching = true config.cache_store = :mem_cache_store config.action_mailer.raise_delivery_errors = false config.action_mailer.delivery_method = :smtp config.action_mailer.smtp_settings = { ...took these settings out for this post... } 
+4
source share
3 answers

FIXED:

Well, after removing the fix for this error until I had to (today), I finally found the source of the problem.

Inclusion of a line: config.threadsafe!

In my file "production.rb" this caused.

 I finally found it by: 1. Making my production and development environment files identical 2. Line-by-line, changing the production environment file until it either: a. The app broke in production mode b. I was back to my original production file 

Anyway, when I had to add "config.threadsafe!" line - IT BROKE! I was never so glad that I had a break in the application.

So, a little reading to understand what exactly this option does, in combination with Mongrel (if Mongrel is even appropriate), and I will answer.

+1
source

I came here with the same problem and just wanted to pass the note to everyone who is experiencing the same .... I managed to solve this problem by installing the version of gems in environment.rb

changed that config.gem "act-as-taggable-on" ,: source => " http://gemcutter.org "

:
config.gem "act-as-taggable-on" ,: source => " http://gemcutter.org ",: version => '2.0. 0.rc1

and run the rake: install

I wonder if you somehow used different gems in different environments, if possible.

+1
source

Do you have acts_as_taggable_on_steroids stone installed on your acts_as_taggable_on_steroids server?

0
source

Source: https://habr.com/ru/post/1303883/


All Articles