Comments (13)
Hmm, I merged the codebase (and manually require
ed 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.
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.
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.
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)?
from requirejs-rails.
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.
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.
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.
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.
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.
@gurdotan Thanks, closing this issue.
from requirejs-rails.
@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.
@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.
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)
- Precompiled asset doesn't generate new digest filename
- Precompiling process is considered slow HOT 7
- uninitialized constant Sprockets::DigestUtils in 0.9.9 HOT 16
- Non-digested files are not created in public/assets
- "rake assets:precompile" raise error at new rails project HOT 10
- undefined method requirejs_include_tag HOT 1
- Almond build broken
- Missing local paths config in development
- Rails 4.2.5.1: NoMethodError: undefined method `paths' for nil:NilClass HOT 23
- Updating to 4.2.5.1 breaks app HOT 1
- sprockets-rails >= 3 throws "Asset was not declared to be precompiled in production" HOT 2
- error : = requirejs_include_tag "application HOT 1
- Error raised on requirejs_include_tags
- RequireJS concatenating JS but not minifying HOT 2
- Precompile doesn't appear to work on Sprockets 3 (Rails 5) HOT 1
- coffeescript compiled every time when request
- css files included with !text are getting stripped from /src/ HOT 2
- requirejs-rails isn't working with rails >= 5.1 because erubis has been replaced with erubi HOT 4
- Multiple Errors when requiring files
- Error: TypeError: content.replace is not a function
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from requirejs-rails.