Closed tdtadeu closed 9 years ago
Have you tried with 4.2.0.rc2?
I create a new application and it is working fine. It seems to be something related to your setup.
I ran into the same problem. I ran rails _4.2.0rc2_ new jquery_rails_test
and checked Gemfile.lock to make sure I was running jquery-rails 4.0.0. Then I created a scaffold bin/rails g scaffold posts
, started the rails server, and went to localhost:3000/posts
. Then I got:
couldn't find file 'jquery'
(in /Users/smidwap/development/jquery_test/app/assets/javascripts/application.js:13)
I downgraded to jquery-rails 3.0.2, and the problem went away.
I also tried upgrading an existing app to rails 4.2.0rc2. I didn't run into any issues, since my jquery-rails version had been locked at 3.0.2. Sure enough, when I upgraded jquery-rails to 4.0.0, the error came back.
Figured it out. It was a permissions problem. I ran chown
where jquery-rails 4.0.0 is installed (/Library/Ruby/Gems/2.0.0/gems/jquery-rails-4.0.0
) to change the owner from root
to my local mac username. I restarted my Rails server, and jquery is now found.
Interestingly, root
is the owner of my local jquery-rails-3.0.2 directory. I'm not sure what changed in 4.0.0 that made root no longer work. Maybe the removal of action_view/railtie
?
I'm trying to update the gem in a project using Rails 4.2.0.beta4, but it seems that the jquery file can't be found. I tried changing the jquery-rails version back to 3.1.2 and it works with that version, the problem does seem to be with the current version.
Playing a little in the console I found when you try to require the gem (4.0) it gives you an error, while requiring the 3.1.2 only returns false.
The error in the title happens in the
<%= javascript_include_tag "application" %>
line of the application layout, of course.Here's the application.js:
Gemfile, in case you need it: