Code Monkey home page Code Monkey logo

Comments (13)

neersighted avatar neersighted commented on August 10, 2024

Hmm, I merged the codebase (and manually requireed it) into my app, and it still didn't work. Does requirejs_rails not work with config.threadsafe!? (In development Rack::Lock is removed, but all other config.threadsafe! options are off. It fails there too.)

from requirejs-rails.

neersighted avatar neersighted commented on August 10, 2024

I fixed this by adding the code inline to my ApplicationHelper (a ugly hack, yes). For some reason, my app is not loading anything but the ApplicationHelper. Closing this for now, because this issue is not related to the gem itself.

from requirejs-rails.

gurdotan avatar gurdotan commented on August 10, 2024

Hi @neersighted ,

I've been experiencing the exact same issue. The weird thing about it is that it happens only in a production rails environment:

ActionView::Template::Error (undefined method 'requirejs_include_tag' for #<#<Class:0x00000002a32d00>:0x00000002d9a718>)

This happens on production (Apache + Passenger + Rails 3.2.9). Locally when running rails with Thin, it works fine. I tried inlining the code into ApplicationHelper but it didn't work. Obviously I did somehthing wrong. Can you post your implementation here \ provide a gist?

Thanks a bunch

from requirejs-rails.

neersighted avatar neersighted commented on August 10, 2024

It seems this is a requirejs-rails issue (in the Railtie, maybe)? I gave up on using it in my apps a while back, though. I think that the code is not being loaded when config.threadsafe! is on (missing eager-loading)?

/cc @gurdotan @jwhitley

from requirejs-rails.

jwhitley avatar jwhitley commented on August 10, 2024

Would someone who's seen this issue please attempt to repro on current master? The fixes both in 0.9.1 and in unreleased fixes may impact this problem.

from requirejs-rails.

neersighted avatar neersighted commented on August 10, 2024

On 01/06/2013 10:46 AM, John Whitley wrote:

Would someone who's seen this issue please attempt to repro on current
|master|? The fixes both in 0.9.1 and in unreleased fixes may impact
this problem.


Reply to this email directly or view it on GitHub
#73 (comment).

Sure, trying in a bit!

[PGP]: AF636755/Neer Sighted (neersighted) [email protected]

from requirejs-rails.

Zelnox avatar Zelnox commented on August 10, 2024

I’m getting this with rails 3.2.11 with the 0.9.1 gem and ruby 1.9.3-p374. It loads fine in dev, but borks in staging/prod.

I fixed my problem. It was unrelated to the gem. The problem was from this line in config/application.rb where gems in the :assets group weren’t loaded in staging.

Bundler.require(*Rails.groups(:assets => %w(development test)))

from requirejs-rails.

paulRbr avatar paulRbr commented on August 10, 2024

I've had the same issue as @gurdotan on my project:
Working in dev
Not working in test and production env

I am not quite sure what's going on there but I had to manually include the helper in the ActionView.
See paulRbr@34d0306

Btw I am on ruby 1.9.3-p448, rails 3.2.13, requirejs-rails 0.9.1

I could not reproduce with a simple gist, I guess it might be my app that is not configured correctly..

from requirejs-rails.

gurdotan avatar gurdotan commented on August 10, 2024

Back to this issue, seems like @Zelnox came up with the right solution. I've also upgraded to v0.9.2 and now it seems to work. On my behalf this issue can be closed. Thanks for the support!

from requirejs-rails.

jwhitley avatar jwhitley commented on August 10, 2024

@gurdotan Thanks, closing this issue.

from requirejs-rails.

paularmstrong avatar paularmstrong commented on August 10, 2024

@Zelnox, @gurdotan: You guys say that line was the issue, but what was the fix that you did to the line to make it work?

from requirejs-rails.

Zelnox avatar Zelnox commented on August 10, 2024

@paularmstrong I don’t remember anymore. I think I added the the missing environments to that line for the gem to be loaded in those environments.

from requirejs-rails.

gurdotan avatar gurdotan commented on August 10, 2024

In my case what I had in this line was:

Bundler.require(*Rails.groups(:assets => %w(development test)))

The fix was to add the environments I was deploying to into this list as well:

Bundler.require(*Rails.groups(:assets => %w(development test staging production)))

from requirejs-rails.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.