Errno::EACCEs...something to do with 'Sprockets' - ruby-on-rails

Can anyone tell me how I can resolve this error that has started appearing in my app? Thanks for any help.
Soemthing to do with...Sprockets? My app was working fine until recently. With regards 'line 9', application.js is in the admin folder, in Assets, as it should be, and I haven't changed the code.
Errno::EACCES in Admin/users#index
Showing /home/mycompaq/myapp/app/views/layouts/admin/application.html.erb where line #9 raised:
Permission denied - /home/mycompaq/myapp/tmp/cache/assets/sprockets%2Fb250691303afe8bdea5daa9e24412c8020130818-2524-njp18c-0 or /home/mycompaq/myapp/tmp/cache/assets/D5C/180/sprockets%2Fb250691303afe8bdea5daa9e24412c80
Extracted source (around line #9):
6: <title><%= content_for?(:title) ? yield(:title) : admin_area_title %></title>
7: <%= csrf_meta_tags %>
8: <%= stylesheet_link_tag "admin/application", :media => "all" %>
9: <%= javascript_include_tag "admin/application" %>
10: <% if #include_goole_maps %>
11: <script type="text/javascript" src="https://maps.google.com/maps/api/js?sensor=true&libraries=places"></script>
12: <% end %>
Rails.root: /home/mycompaq/myapp
Application Trace | Framework Trace | Full Trace
app/views/layouts/admin/application.html.erb:9:in `_app_views_layouts_admin_application_html_erb___1652810648_69910752274140'

Easy solution. Just deleted the tmp folder and its contents in my application folder with:
rm -r tmp
Probably a good idea to back it up elsewhere, first, just in case.

Related

Michael Hrtl's Ruby on Rails Tutorial ep 5. Changing the hash from :media to media: doesn't work

only on tutorial 5 and I am stumped.
This is similar to a previous post by user1420228, but the answer given didn't really resolve the problem.
In Michael Hartl's application_helper.rb file:
<!DOCTYPE html>
<html>
<head>
<title> <%=full_title(yield(:title)) %> </title>
<%= stylesheet_link_tag "application", :media => "all" %>
<%= javascript_include_tag "application" %>
<%= csrf_meta_tags %>
</head>
<body>
<%= yield %>
</body>
</html>
However, he suggests changing the :media hash to the newer media:.
He makes the change and demonstrates the sample app working.
I made the same change and the sample app failed with the following error:
SyntaxError in Static_pages#home
Showing /Users/osmanahmed/Rails_Projects/sample_app/app/views/layouts/application.html.erb where line #5 raised:
/Users/osmanahmed/Rails_Projects/sample_app/app/views/layouts/application.html.erb:5: syntax error, unexpected tASSOC
...tag "application", media: => "all" );#output_buffer.safe_...
... ^
Extracted source (around line #5):
2: <html>
3: <head>
4: <title> <%=full_title(yield(:title)) %> </title>
5: <%= stylesheet_link_tag "application", media: => "all" %>
6: <%= javascript_include_tag "application" %>
7: <%= csrf_meta_tags %>
8: </head>
Trace of template inclusion: app/views/layouts/application.html.erb
Rails.root: /Users/osmanahmed/Rails_Projects/sample_app
ruby -v gives me: ruby 1.9.3p392
rvm -v gives me 1.20.13
rails - v is 3.2.13
As a side issue, if I ignore the change to the new hash everything works fine, but if I progress further in the tutorial I find that my static home page contents load twice. So I suspect I should try and fix this issue before I try and debug the new "page loading twice error"
I am guessing this is a configuration issue, either I have loaded the incorrect gemfile or something.
Can anyone point me in the right direction please?
Oz
Looks like you're doing media: => "all". It should be media: "all". No hash-rocket.

Twitter Bootstrap Error Using Less

Following this video
After generating the app, scaffolding, updating gemfile, running bundle install, and running rails server, getting ERROR.
Am using the gem
'twitter-bootstrap-rails'
, is there a reason why it is having an issue with "less?" =>
ActionView::Template::Error (cannot load such file -- less (in
/Users/ryanmindigo/store/app/assets/stylesheets/bootstrap_and_overrides.css.less)):
2: <html>
3: <head>
4: <title>Store</title>
5: <%= stylesheet_link_tag "application", :media => "all" %>
6: <%= javascript_include_tag "application" %>
7: <%= csrf_meta_tags %>
8: </head>
app/views/layouts/application.html.erb:5:in `_app_views_layouts_application_html_erb__2789023687141131830_70195710799000'
app/controllers/products_controller.rb:7:in `index'
Deleting the bootstrap_and_overrides.css.less file, may not be necessary with updated gem. Please comment if a new error appears so we could see some more.

symbol lookup error: node: undefined symbol: _ZN2v86LockerC1EPNS_7IsolateE

I am try to use ember.js with rails, I follow the railscasts http://railscasts.com/episodes/408-ember-part-1 and get this error
Showing /home/william/codes/408-ember-part-1/raffler- after/app/views/layouts/application.html.erb where line #6 raised:
node: symbol lookup error: node: undefined symbol: _ZN2v86LockerC1EPNS_7IsolateE
(in /home/william/codes/408-ember-part-1/raffler- after/app/assets/javascripts/store.js.coffee)
Extracted source (around line #6):
3: <head>
4: <title>Raffler</title>
5: <%= stylesheet_link_tag "application", :media => "all" %>
6: <%= javascript_include_tag "application" %>
7: <%= csrf_meta_tags %>
8: </head>
9: <body>
Rails.root: /home/william/codes/408-ember-part-1/raffler-after
at the beginning I think it may be some thing I made wrong, but as you can see, I try the source code from railscast, still get this error
I am use openSUSE 12.3 and installed nodejs as javascript compiler
Solved by install nodejs from source

Rails can't generate Tempfile

I installed my rails-app via Passenger on my apache but I'm getting a strange error
cannot generate tempfile `/var/rails/wo42/tmp/cache/assets/sprockets%2Fb94bb762c37131f8bb65f843c621876720120401-29970-ha7f1p-9'
Extracted source (around line #24):
21: <%= stylesheet_link_tag "application" %>
22:
23: <!-- Included JS Files -->
24: <%= javascript_include_tag "application" %>
25:
26: <%= csrf_meta_tags %>
27: </head>
It seems to be something with the rights but I set /var/rails/wo42/tmp to chmod 777?
I just ran into this myself. Not sure if this will be a permanent fix, but here is what got me past it:
rake tmp:clear

rails 3.1 windows new project js issue

I've just installed rails 3.1 and generated a test application to take the changes for a spin. But after updating creating the pages controller and updating the routes to point ot paged#index I get this:
Showing D:/Projects/randomTest/app/views/layouts/application.html.erb where line #6 raised:
["ok","(function() {\n\n}).call(this);\n"]
(in D:/Projects/randomTest/app/assets/javascripts/pages.js.coffee)
Extracted source (around line #6):
3: <head>
4: <title>RandomTest</title>
5: <%= stylesheet_link_tag "application" %>
6: <%= javascript_include_tag "application" %>
7: <%= csrf_meta_tags %>
8: </head>
9: <body>
Any idea ?
Thanks,
Ok,
So I managed to figured it out, looked like I had to install execjs gem, a simple:
gem install execjs
Did the trick !

Resources