sprockets-rails dependency #210

Closed
javiercr opened this Issue Apr 17, 2012 · 10 comments

Projects

None yet

4 participants

@javiercr
Contributor

In order to run Mercury in development I needed to add sprockets-rails gem instead of sprockets-helpers, otherwise I was getting this error:

/Users/javi/.rvm/gems/ruby-1.9.2-p180@mercury-rails/gems/actionpack-3.2.3/lib/sprockets/railtie.rb:46:in `block (2 levels) in <class:Railtie>': uninitialized constant Sprockets::Helpers::RailsHelper (NameError)
    from /Users/javi/.rvm/gems/ruby-1.9.2-p180@mercury-rails/gems/activesupport-3.2.3/lib/active_support/lazy_load_hooks.rb:36:in `instance_eval'
    from /Users/javi/.rvm/gems/ruby-1.9.2-p180@mercury-rails/gems/activesupport-3.2.3/lib/active_support/lazy_load_hooks.rb:36:in `execute_hook'
    from /Users/javi/.rvm/gems/ruby-1.9.2-p180@mercury-rails/gems/activesupport-3.2.3/lib/active_support/lazy_load_hooks.rb:26:in `block in on_load'
    from /Users/javi/.rvm/gems/ruby-1.9.2-p180@mercury-rails/gems/activesupport-3.2.3/lib/active_support/lazy_load_hooks.rb:25:in `each'
    from /Users/javi/.rvm/gems/ruby-1.9.2-p180@mercury-rails/gems/activesupport-3.2.3/lib/active_support/lazy_load_hooks.rb:25:in `on_load'
    from /Users/javi/.rvm/gems/ruby-1.9.2-p180@mercury-rails/gems/actionpack-3.2.3/lib/sprockets/railtie.rb:45:in `block in <class:Railtie>'
    from /Users/javi/.rvm/gems/ruby-1.9.2-p180@mercury-rails/gems/railties-3.2.3/lib/rails/initializable.rb:30:in `instance_exec'
    from /Users/javi/.rvm/gems/ruby-1.9.2-p180@mercury-rails/gems/railties-3.2.3/lib/rails/initializable.rb:30:in `run'
    from /Users/javi/.rvm/gems/ruby-1.9.2-p180@mercury-rails/gems/railties-3.2.3/lib/rails/initializable.rb:55:in `block in run_initializers'
    from /Users/javi/.rvm/gems/ruby-1.9.2-p180@mercury-rails/gems/railties-3.2.3/lib/rails/initializable.rb:54:in `each'
    from /Users/javi/.rvm/gems/ruby-1.9.2-p180@mercury-rails/gems/railties-3.2.3/lib/rails/initializable.rb:54:in `run_initializers'
    from /Users/javi/.rvm/gems/ruby-1.9.2-p180@mercury-rails/gems/railties-3.2.3/lib/rails/application.rb:136:in `initialize!'
    from /Users/javi/.rvm/gems/ruby-1.9.2-p180@mercury-rails/gems/railties-3.2.3/lib/rails/railtie/configurable.rb:30:in `method_missing'
    from /Users/javi/Sites/mercury/config/environment.rb:5:in `<top (required)>'
    from /Users/javi/Sites/mercury/config.ru:4:in `block in <main>'
    from /Users/javi/.rvm/gems/ruby-1.9.2-p180@mercury-rails/gems/rack-1.4.1/lib/rack/builder.rb:51:in `instance_eval'
    from /Users/javi/.rvm/gems/ruby-1.9.2-p180@mercury-rails/gems/rack-1.4.1/lib/rack/builder.rb:51:in `initialize'
    from /Users/javi/Sites/mercury/config.ru:1:in `new'
    from /Users/javi/Sites/mercury/config.ru:1:in `<main>'
    from /Users/javi/.rvm/gems/ruby-1.9.2-p180@mercury-rails/gems/rack-1.4.1/lib/rack/builder.rb:40:in `eval'
    from /Users/javi/.rvm/gems/ruby-1.9.2-p180@mercury-rails/gems/rack-1.4.1/lib/rack/builder.rb:40:in `parse_file'
    from /Users/javi/.rvm/gems/ruby-1.9.2-p180@mercury-rails/gems/rack-1.4.1/lib/rack/server.rb:200:in `app'
    from /Users/javi/.rvm/gems/ruby-1.9.2-p180@mercury-rails/gems/railties-3.2.3/lib/rails/commands/server.rb:46:in `app'
    from /Users/javi/.rvm/gems/ruby-1.9.2-p180@mercury-rails/gems/rack-1.4.1/lib/rack/server.rb:301:in `wrapped_app'
    from /Users/javi/.rvm/gems/ruby-1.9.2-p180@mercury-rails/gems/rack-1.4.1/lib/rack/server.rb:252:in `start'
    from /Users/javi/.rvm/gems/ruby-1.9.2-p180@mercury-rails/gems/railties-3.2.3/lib/rails/commands/server.rb:70:in `start'
    from /Users/javi/.rvm/gems/ruby-1.9.2-p180@mercury-rails/gems/railties-3.2.3/lib/rails/commands.rb:55:in `block in <top (required)>'
    from /Users/javi/.rvm/gems/ruby-1.9.2-p180@mercury-rails/gems/railties-3.2.3/lib/rails/commands.rb:50:in `tap'
    from /Users/javi/.rvm/gems/ruby-1.9.2-p180@mercury-rails/gems/railties-3.2.3/lib/rails/commands.rb:50:in `<top (required)>'
    from script/rails:6:in `require'
    from script/rails:6:in `<main>'

See my commit: 6c0c84e7b886cc0428cc9174eb0042593227551b.

I'm note sure if this new dependency works for everyone, if you think so I can make a pull request.

Regards!

@woto
woto commented Apr 21, 2012

got same error for now on master 6d9c99f

@gvarela
Collaborator
gvarela commented May 25, 2012

I got the same error. I currently commented out that gem dependency as it seems to be unnecessary for rails 3.2. @jejacks0n can you provide insight into what this gem was providing?

@jejacks0n
Owner

Yeah, so... That sprockets stuff has flailed around for a while, changing a lot every release. There were issues in various rails releases, and maybe it's been resolved?

The reason that's there currently is because of some view/css helper method on asset compile.

On May 25, 2012, at 10:58 AM, Gabe Varelareply@reply.github.com wrote:

I got the same error. I currently commented out that gem dependency as it seems to be unnecessary for rails 3.2. @jejacks0n can you provide insight into what this gem was providing?


Reply to this email directly or view it on GitHub:
#210 (comment)

@gvarela
Collaborator
gvarela commented May 25, 2012

@woto @javiercr I just committed some fixes to the gem dependencies can you verify that this is working on your end? You may need to blow away your Gemfile.lock and re bundle to ensure the dependencies are resolving correctly.

@jejacks0n
Owner

So, the build rake task is failing -- I assume this may effect people trying to deploy to production as well.

undefined method `asset_path' for #<#:0x007fafb4e9e650>
  (in /Users/jeremy.jackson/Documents/mercury-rails/vendor/assets/stylesheets/mercury/all_images.css.erb)

I'll do some research and try to figure out why that's not available anymore / not required in that case.

@gvarela
Collaborator
gvarela commented May 25, 2012

Ah boo. I can take a look at that. I am trying to get the cucumber stuff passing so I can make some updates.

Gabe Varela

On Friday, May 25, 2012 at 11:43 AM, Jeremy Jackson wrote:

So, the build rake task is failing -- I assume this may effect people trying to deploy to production as well.

undefined method `asset_path' for #<#:0x007fafb4e9e650>
(in /Users/jeremy.jackson/Documents/mercury-rails/vendor/assets/stylesheets/mercury/all_images.css.erb)

I'll do some research and try to figure out why that's not available anymore / not required in that case.


Reply to this email directly or view it on GitHub:
#210 (comment)

@gvarela
Collaborator
gvarela commented May 25, 2012

I didn't get that error when I ran rake mercury:build. We must have some gem version discrepancies between our environments. Below is my bundle list.

Gems included by the bundle:

  • actionmailer (3.2.3)
  • actionpack (3.2.3)
  • activemodel (3.2.3)
  • activerecord (3.2.3)
  • activeresource (3.2.3)
  • activesupport (3.2.3)
  • addressable (2.2.8)
  • arel (3.0.2)
  • builder (3.0.0)
  • bundler (1.1.3)
  • capybara (1.1.2)
  • capybara-firebug (1.1.0)
  • childprocess (0.3.2)
  • cocaine (0.2.1)
  • coffee-script (2.2.0)
  • coffee-script-source (1.2.0)
  • cucumber (1.2.0)
  • cucumber-rails (1.3.0)
  • database_cleaner (0.7.2)
  • diff-lcs (1.1.3)
  • erubis (2.7.0)
  • evergreen (1.0.0)
  • execjs (1.4.0)
  • ffi (1.0.11)
  • gherkin (2.10.0)
  • hike (1.2.1)
  • i18n (0.6.0)
  • journey (1.0.3)
  • jquery-rails (2.0.2)
  • json (1.7.3)
  • json_pure (1.7.3)
  • launchy (2.1.0)
  • libwebsocket (0.1.3)
  • mail (2.4.4)
  • mercury-rails (0.3.1 7834e69)
  • mime-types (1.18)
  • multi_json (1.3.5)
  • mustache (0.99.4)
  • nokogiri (1.5.2)
  • paperclip (3.0.4)
  • polyglot (0.3.3)
  • rack (1.4.1)
  • rack-cache (1.2)
  • rack-protection (1.2.0)
  • rack-ssl (1.3.2)
  • rack-test (0.6.1)
  • rails (3.2.3)
  • railties (3.2.3)
  • rake (0.9.2.2)
  • rdoc (3.12)
  • redcarpet (2.1.1)
  • rocco (0.8.2)
  • rspec-core (2.10.1)
  • rubyzip (0.9.8)
  • selenium-webdriver (2.21.2)
  • sinatra (1.3.2)
  • sprockets (2.1.3)
  • sqlite3 (1.3.6)
  • thor (0.14.6)
  • tilt (1.3.3)
  • treetop (1.4.10)
  • tzinfo (0.3.33)
  • uglifier (1.2.4)
  • xpath (0.1.4)
@jejacks0n
Owner

The only difference is this:

mercury-rails (0.3.1 7834e69)

I blew away the gemset and did a fresh bundle -- all versions are the same as yours except for that one anomaly.

@gvarela
Collaborator
gvarela commented May 25, 2012

I cleared out my gemset and re-bundled and now I am seeing the issue. Interestingly rake assets:precompile doesn't fail. Going to look into the difference.

@gvarela
Collaborator
gvarela commented May 25, 2012

So not sure why that gem fixes the build issue. It seems to be a that the rails core team has moved the sprockets integration out of rails proper. It must have some sort of a bug fix in it that fixes the issue.

@gvarela gvarela closed this May 28, 2012
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment