1

I had a running app with no problem and just did bundle update and bundle install and now.

I had not bundle updated for the past 4 months I think.

Now when I run $ rails s, I have this error:

".../gems/sprockets-2.12.3/lib/sprockets/manifest.rb:65:in `read': Is a directory - .../public/assets (Errno::EISDIR)"!

mathieu-To-be-filled-by-O-E-M:~/rails_projects/mathieu_app$ rails s
DEPRECATION WARNING: Support for Rails < 4.1.0 will be dropped. (called from require at /home/mathieu/.rvm/gems/ruby-2.0.0-p451@global/gems/bundler-1.5.3/lib/bundler/runtime.rb:76)
=> Booting WEBrick
=> Rails 4.0.12 application starting in development on http://0.0.0.0:3000
=> Run `rails server -h` for more startup options
=> Ctrl-C to shutdown server
DEPRECATION WARNING: Model based mass assignment security has been extracted
out of Rails into a gem. Please use the new recommended protection model for
params or add `protected_attributes` to your Gemfile to use the old one.

To disable this message remove the `whitelist_attributes` option from your
`config/application.rb` file and any `mass_assignment_sanitizer` options
from your `config/environments/*.rb` files.

See http://guides.rubyonrails.org/security.html#mass-assignment for more information.

Exiting
/home/mathieu/.rvm/gems/ruby-2.0.0-p451@rails3tutorial2ndEd/gems/sprockets-2.12.3/lib/sprockets/manifest.rb:65:in `read': Is a directory - /home/mathieu/rails_projects/mathieu_app/public/assets (Errno::EISDIR)
    from /home/mathieu/.rvm/gems/ruby-2.0.0-p451@rails3tutorial2ndEd/gems/sprockets-2.12.3/lib/sprockets/manifest.rb:65:in `initialize'
    from /home/mathieu/.rvm/gems/ruby-2.0.0-p451@rails3tutorial2ndEd/gems/sprockets-rails-2.2.2/lib/sprockets/railtie.rb:105:in `new'
    from /home/mathieu/.rvm/gems/ruby-2.0.0-p451@rails3tutorial2ndEd/gems/sprockets-rails-2.2.2/lib/sprockets/railtie.rb:105:in `block in <class:Railtie>'
    from /home/mathieu/.rvm/gems/ruby-2.0.0-p451@rails3tutorial2ndEd/gems/activesupport-4.0.12/lib/active_support/lazy_load_hooks.rb:36:in `call'
    from /home/mathieu/.rvm/gems/ruby-2.0.0-p451@rails3tutorial2ndEd/gems/activesupport-4.0.12/lib/active_support/lazy_load_hooks.rb:36:in `execute_hook'
    from /home/mathieu/.rvm/gems/ruby-2.0.0-p451@rails3tutorial2ndEd/gems/activesupport-4.0.12/lib/active_support/lazy_load_hooks.rb:45:in `block in run_load_hooks'
    from /home/mathieu/.rvm/gems/ruby-2.0.0-p451@rails3tutorial2ndEd/gems/activesupport-4.0.12/lib/active_support/lazy_load_hooks.rb:44:in `each'
    from /home/mathieu/.rvm/gems/ruby-2.0.0-p451@rails3tutorial2ndEd/gems/activesupport-4.0.12/lib/active_support/lazy_load_hooks.rb:44:in `run_load_hooks'
    from /home/mathieu/.rvm/gems/ruby-2.0.0-p451@rails3tutorial2ndEd/gems/railties-4.0.12/lib/rails/application/finisher.rb:62:in `block in <module:Finisher>'
    from /home/mathieu/.rvm/gems/ruby-2.0.0-p451@rails3tutorial2ndEd/gems/railties-4.0.12/lib/rails/initializable.rb:30:in `instance_exec'
    from /home/mathieu/.rvm/gems/ruby-2.0.0-p451@rails3tutorial2ndEd/gems/railties-4.0.12/lib/rails/initializable.rb:30:in `run'
    from /home/mathieu/.rvm/gems/ruby-2.0.0-p451@rails3tutorial2ndEd/gems/railties-4.0.12/lib/rails/initializable.rb:55:in `block in run_initializers'
    from /home/mathieu/.rvm/rubies/ruby-2.0.0-p451/lib/ruby/2.0.0/tsort.rb:150:in `block in tsort_each'
    from /home/mathieu/.rvm/rubies/ruby-2.0.0-p451/lib/ruby/2.0.0/tsort.rb:183:in `block (2 levels) in each_strongly_connected_component'
    from /home/mathieu/.rvm/rubies/ruby-2.0.0-p451/lib/ruby/2.0.0/tsort.rb:219:in `each_strongly_connected_component_from'
    from /home/mathieu/.rvm/rubies/ruby-2.0.0-p451/lib/ruby/2.0.0/tsort.rb:182:in `block in each_strongly_connected_component'
    from /home/mathieu/.rvm/rubies/ruby-2.0.0-p451/lib/ruby/2.0.0/tsort.rb:180:in `each'
    from /home/mathieu/.rvm/rubies/ruby-2.0.0-p451/lib/ruby/2.0.0/tsort.rb:180:in `each_strongly_connected_component'
    from /home/mathieu/.rvm/rubies/ruby-2.0.0-p451/lib/ruby/2.0.0/tsort.rb:148:in `tsort_each'
    from /home/mathieu/.rvm/gems/ruby-2.0.0-p451@rails3tutorial2ndEd/gems/railties-4.0.12/lib/rails/initializable.rb:54:in `run_initializers'
    from /home/mathieu/.rvm/gems/ruby-2.0.0-p451@rails3tutorial2ndEd/gems/railties-4.0.12/lib/rails/application.rb:215:in `initialize!'
    from /home/mathieu/.rvm/gems/ruby-2.0.0-p451@rails3tutorial2ndEd/gems/railties-4.0.12/lib/rails/railtie/configurable.rb:30:in `method_missing'
    from /home/mathieu/rails_projects/mathieu_app/config/environment.rb:5:in `<top (required)>'
    from /home/mathieu/.rvm/gems/ruby-2.0.0-p451@rails3tutorial2ndEd/gems/activesupport-4.0.12/lib/active_support/dependencies.rb:229:in `require'
    from /home/mathieu/.rvm/gems/ruby-2.0.0-p451@rails3tutorial2ndEd/gems/activesupport-4.0.12/lib/active_support/dependencies.rb:229:in `block in require'
    from /home/mathieu/.rvm/gems/ruby-2.0.0-p451@rails3tutorial2ndEd/gems/activesupport-4.0.12/lib/active_support/dependencies.rb:214:in `load_dependency'
    from /home/mathieu/.rvm/gems/ruby-2.0.0-p451@rails3tutorial2ndEd/gems/activesupport-4.0.12/lib/active_support/dependencies.rb:229:in `require'
    from /home/mathieu/rails_projects/mathieu_app/config.ru:3:in `block in <main>'
    from /home/mathieu/.rvm/gems/ruby-2.0.0-p451@global/gems/rack-1.5.2/lib/rack/builder.rb:55:in `instance_eval'
    from /home/mathieu/.rvm/gems/ruby-2.0.0-p451@global/gems/rack-1.5.2/lib/rack/builder.rb:55:in `initialize'
    from /home/mathieu/rails_projects/mathieu_app/config.ru:in `new'
    from /home/mathieu/rails_projects/mathieu_app/config.ru:in `<main>'
    from /home/mathieu/.rvm/gems/ruby-2.0.0-p451@global/gems/rack-1.5.2/lib/rack/builder.rb:49:in `eval'
    from /home/mathieu/.rvm/gems/ruby-2.0.0-p451@global/gems/rack-1.5.2/lib/rack/builder.rb:49:in `new_from_string'
    from /home/mathieu/.rvm/gems/ruby-2.0.0-p451@global/gems/rack-1.5.2/lib/rack/builder.rb:40:in `parse_file'
    from /home/mathieu/.rvm/gems/ruby-2.0.0-p451@global/gems/rack-1.5.2/lib/rack/server.rb:277:in `build_app_and_options_from_config'
    from /home/mathieu/.rvm/gems/ruby-2.0.0-p451@global/gems/rack-1.5.2/lib/rack/server.rb:199:in `app'
    from /home/mathieu/.rvm/gems/ruby-2.0.0-p451@rails3tutorial2ndEd/gems/railties-4.0.12/lib/rails/commands/server.rb:48:in `app'
    from /home/mathieu/.rvm/gems/ruby-2.0.0-p451@global/gems/rack-1.5.2/lib/rack/server.rb:314:in `wrapped_app'
    from /home/mathieu/.rvm/gems/ruby-2.0.0-p451@rails3tutorial2ndEd/gems/railties-4.0.12/lib/rails/commands/server.rb:75:in `start'
    from /home/mathieu/.rvm/gems/ruby-2.0.0-p451@rails3tutorial2ndEd/gems/railties-4.0.12/lib/rails/commands.rb:76:in `block in <top (required)>'
    from /home/mathieu/.rvm/gems/ruby-2.0.0-p451@rails3tutorial2ndEd/gems/railties-4.0.12/lib/rails/commands.rb:71:in `tap'
    from /home/mathieu/.rvm/gems/ruby-2.0.0-p451@rails3tutorial2ndEd/gems/railties-4.0.12/lib/rails/commands.rb:71:in `<top (required)>'
    from bin/rails:4:in `require'
    from bin/rails:4:in `<main>'

My gem list:

source 'https://rubygems.org'
ruby "2.0.0"                  # source: https://devcenter.heroku.com/articles/ruby-versions

# Rails 4
gem 'rails', "~> 4.0.3"
# Gems supporting Rails 4 core architecture
gem 'actionpack-action_caching'
gem 'actionpack-page_caching'
gem 'activerecord-session_store'
gem 'activeresource'
gem 'rails-observers'
gem 'turbolinks'

gem 'pg'
gem 'anjlab-bootstrap-rails', :require  => 'bootstrap-rails',
                              :github   => 'anjlab/bootstrap-rails',
                              :branch   => '3.0.0'
gem 'devise'                  # authentification
gem 'cancan'                  # authorization
gem 'rolify',                 :git => 'git://github.com/EppO/rolify.git' # role management library with resource scoping, added fork due to bug source - stackoverflow.com/questions/13712012/error-pushing-to-heroku-aborting-my-rake-assetsprecompile?rq=1 
gem 'figaro'                  # rails app configuration and keep private stuff...private
gem 'sendgrid'                # sendgrid gem
gem 'faker'                   # to create fake user accounts
gem 'will_paginate'           # pagination method
gem 'bootstrap-will_paginate' # configure will_paginate gem to bootstrap pagination style
gem 'font-awesome-rails'      # pure css icons
gem 'validates_timeliness'    # methods and validations for dates formats
gem 'validate_url'            # for URL validations in forms
gem 'dotiw'                   # overrides the default distance_of_time_in_words and provides a more accurate output 
gem 'friendly_id'             

# Forms with formtastic
gem 'formtastic'
gem 'formtastic-bootstrap'

# Active admin stuff
gem 'activeadmin',            github: 'gregbell/active_admin' # added github because of deployment issue wiht jquery ui http://stackoverflow.com/questions/16844411/rails-active-admin-deployment-couldnt-find-file-jquery-ui
gem 'sass-rails',             '~> 4.0.1' # Master branch not OK with Rails 4, hence we point to branch that comply with Rails 4
gem 'kaminari'                #'0.14.1' active admin needs kaminari for pagination; blocked on 0.14.1 because if not get nomethod error per_page kaminari https://github.com/sferik/rails_admin/issues/1868 and https://github.com/amatsuda/kaminari/issues/481
gem 'postgres_ext'            # gives a nice set of query methods & Adds missing native PostgreSQL data types to ActiveRecord and convenient querying extensions for ActiveRecord and Arel for Rails 4.x

gem 'jquery-rails'
gem 'chosen-rails'            
gem 'coffee-rails',           '~> 4.0.1' # Master branch not OK with Rails 4, hence we point to branch that comply with Rails 4 by default 
gem 'uglifier'                

# Geocoding and locations
gem 'geocoder'                
gem 'country-select'          

group :production do
  gem 'rails_12factor'        
end     


group :development do
  gem 'quiet_assets'          # mutes assets pipeline log messages
  gem 'better_errors'         # improve error pages
  # retrieve  binding of a method's caller in MRI 1.9.2+, only for debugging
  gem 'binding_of_caller', platforms: [:mri_19, :rbx]
end


group :development, :test do
  gem 'perftools.rb',         require: 'perftools' # used to find tasks taking long time (ex when test are too long)
  gem 'guard',                '>=2.1.0'
  gem 'guard-rspec'
  gem 'guard-rails-assets'    
  gem 'rspec-rails'
  gem 'factory_girl_rails'    
  gem 'pry-rails'             
  gem 'rspec-collection_matchers' 
  gem 'i18n-tasks'            
end

group :test do
  gem 'capybara'
  gem 'selenium-webdriver'     -ex: flash error messages...
  gem 'capybara-webkit'        -ex: flash error messages...
  gem 'rb-inotify'            
  gem 'libnotify'
  gem 'database_cleaner'      
  gem 'email_spec'            
  gem 'cucumber-rails',       :require => false   #
  gem 'launchy'               
  gem 'shoulda-matchers'      
  gem 'minitest'              
  gem 'guard-zeus-client'     
user229044
  • 232,980
  • 40
  • 330
  • 338
Mathieu
  • 4,587
  • 11
  • 57
  • 112

3 Answers3

1

If you look in the source code of the sprockets gem (where the error is coming from) you can see that the error is being raised by these lines:

63  begin
64    if File.exist?(@path)
65      data = json_decode(File.read(@path))
66    end
67  rescue MultiJson::DecodeError => e
68    logger.error "#{@path} is invalid: #{e.class} #{e.message}"
69  end

Line 65 is the problem, specifically File.read(@path) - as shown by your error message (sprockets-2.12.3/lib/sprockets/manifest.rb:65:in `read').

Basically, @path is supposed to be a string representing a filename but it's actually pointing to a directory, which is causing File.read to fail. @path is supposed to be pointing to your asset's manifest file (usually created automatically by Sprockets) and I'm not sure why it's getting the incorrect path here - do you have anything that looks relevant to your manifest file in config/application.rb or in your environment config files? What about in app/assets/javascripts/application.js or app/assets/stylesheets/application.css?

Try editing your local copy of sprockets yourself (run "cd `bundle show sprockets`" from your app's directory to find it) and adding puts @path before line 65 above (just make sure you remember to remove it when you're done!) - what does it say?

GMA
  • 5,816
  • 6
  • 51
  • 80
  • and "I'm not sure why it's getting the incorrect path here" => before doing this bundle update, i was trying to commit and had problems with assets so i did rails: asset: clobber, rails assets:precompile...maybe it'w what caused the problem? – Mathieu Dec 02 '14 at 16:11
  • I did a search on the word 'manifest' and no it's not on application.rb, nor on javascript/application.js nor application.css. It is on config/environments/development.rb: config.assets.manifest = Rails.root.join("public/assets") – Mathieu Dec 02 '14 at 16:13
  • i am going to try what you recommend now – Mathieu Dec 02 '14 at 16:16
  • 1
    `config.assets.manifest = Rails.root.join("public/assets")` could be the culprit. `assets:precompile` should have created a file called `manifest.json` somewhere in your `public` directory - if I'm not mistaken, `config.assets.manifest` should be pointing to this file. Is it? – GMA Dec 02 '14 at 16:18
  • wowo!!!!!! i commented out config.assets.manifest = Rails.root.join("public/assets") and it works – Mathieu Dec 02 '14 at 16:21
  • indeed i has read somewhere that i should have a manifest.json file but I don't. i was surprized at the time not to have one. Should I also try to get this manifest.json file. ? is it important? – Mathieu Dec 02 '14 at 16:21
  • i don't know if it matters but usually i never type assets:precompile, I use zeus + guard – Mathieu Dec 02 '14 at 16:23
  • you don't *have* to have a manifest.json file - sprockets generates one on-the-fly in your production environment (I think). I'm not 100% sure how it works but it should be in the Sprockets documentation somewhere. You probably don't need to worry about it, I never have. – GMA Dec 02 '14 at 16:28
  • Thanks a lot for the answer! i don't know if it's a related issue, but it also seems to be in connection with assets : http://stackoverflow.com/questions/27254368/error-could-not-load-guard-rails-assets-or-find-class-guardrailsassets – Mathieu Dec 02 '14 at 16:36
0

Hmm... Is it possible that you have Sprocket and structure has been changed, or something like that?

Have you tried to remove that directory ( or just rename it )? This guy removed directory mentioned in error and it worked fine: Trying to install rails- EISDIR error .

There seems to be newer version, have you tried to update? (https://rubygems.org/gems/sprockets-rails)

NOTE: This should be comment but I don't have enough reputation for that...

Community
  • 1
  • 1
Miknash
  • 7,888
  • 3
  • 34
  • 46
  • 1
    sprockets 2.12.3 and sprockets-rails 2.2.2 are the latest stable versions at the time of writing and they're what he's using; he probably doesn't want to be using the beta version of sprockets 3 in a production app. – GMA Dec 02 '14 at 16:09
  • true, actually i don't have sprockets explicitly in my gem files. I guess one gem i have must be bound to it. – Mathieu Dec 02 '14 at 16:15
0

Removing or commenting out this line of code in development.rb solves the problem:

config.assets.manifest = Rails.root.join("public/assets")
Stratus3D
  • 4,648
  • 4
  • 35
  • 67
Surge
  • 256
  • 3
  • 16