rubysherpas / forem

The best Rails 3 and Rails 4 forum engine. Ever.
http://forem.herokuapp.com
MIT License
1.55k stars 422 forks source link

Rails 4.1.1 development class reloading issue #675

Closed sr3d closed 9 years ago

sr3d commented 9 years ago

We are trying to integrate Forem into a Rails4.1.1 app but so far we're running into issues with the reloading of the Forem classes in development. For example,

1st request is OK -- we can see the forem page. 2nd request we'd get an error like

NameError in Forem::Categories#show Showing /Users/alex/.rvm/gems/ruby-2.0.0-p247/bundler/gems/forem-c793fb195ad4/app/views/forem/forums/_forum.html.erb where line #7 raised:

uninitialized constant Forem::Forum::Post

Disabling the cache reloading in config/environments/development.rb (config.cache_classes = true) fixes the issue since now the classes don't get reloaded.

We're using Forem off the rails4 branch already:

gem 'forem', :github => "radar/forem", :branch => "rails4"

neocanable commented 9 years ago

+1 we got same things

radar commented 9 years ago

Please show me your Gemfile.

cjbottaro commented 9 years ago

+1 Same issue here. For me, every time it's uninitialized constant Forem::StateWorkflow. I have to restart my server almost every time I make a change. Development is extremely painful now.

Gemfile: https://gist.github.com/cjbottaro/4373517f4a8efcb6e3e1

radar commented 9 years ago

Any particular reason why you're stuck on 4.1.1 and can't upgrade to 4.2.4?

cjbottaro commented 9 years ago

I'm not sure what you mean. The Gemfile that I posted shows 4.2.4. In fact, I had to upgrade to 4.2.4 (from 4.2.3) just to get it to work (due to dependencies specified in the gemspec).

radar commented 9 years ago

You're commenting on an issue that says it has a problem with 4.1.1. You said you have the same issue.

I didn't see that your Gemfile contained 4.2.4.

On 31 Aug 2015, at 11:04, Christopher J. Bottaro notifications@github.com wrote:

I'm not sure what you mean. The Gemfile that I posted shows 4.2.4. In fact, I had to upgrade to 4.2.4 (from 4.2.3) just to get it to work (due to dependencies specified in the gemspec).

— Reply to this email directly or view it on GitHub.

cjbottaro commented 9 years ago

Whoops, sorry about that. I meant to say I'm also experiencing this with Rails 4.2.4.

radar commented 9 years ago

Could someone please share with me a basic application which reproduces this issue? I'm having a hard time reproducing it myself.

radar commented 9 years ago

This is fixed now by #679.