pedro / rails3_serve_static_assets

Rails 3 plugin to always enable serving of static assets
10 stars 4 forks source link

This is giving me an error when pushing a Rails 3.1.0beta app to Heroku #1

Open bborn opened 13 years ago

bborn commented 13 years ago

I get:

undefined method `configure' for Rails::Application:Class
vendor/plugins/rails3_serve_static_assets/init.rb:1:in `block in <class:Plugin>'
wickkidd commented 13 years ago

+1 I've got a ticket filed with Heroku.

mathieulegrand commented 13 years ago

Any update on that issue?

sferik commented 13 years ago

+1 same issue here

sferik commented 13 years ago

Never mind. I found a workaround: Just update your config/production.rb to say:

config.serve_static_assets = true

For example: https://github.com/codeforamerica/adopt-a-hydrant/commit/2e14d25e94aec73d2ac5013b44281a387217a2cb

mathieulegrand commented 13 years ago

Yes that works fine. Also, Rack must be a gem when deploying to Heroku. That means that the GIT version of Rails will fail, but the recently released gem version of Rails 3.1.0beta1 will work.

clemens commented 13 years ago

How does it work for you, Mathieu? I'm always getting errors, independent of the config.serve_static_assets setting ...

sferik commented 13 years ago

@clements What error are you getting? (check heroku logs)

clemens commented 13 years ago

The same as the ticket opener: 2011-05-08T20:05:00+00:00 app[web.1]: /app/vendor/plugins/rails3_serve_static_assets/init.rb:1:in block in <class:Plugin>': undefined methodconfigure' for Rails::Application:Class (NoMethodError)

sferik commented 13 years ago

What Heroku stack are you running on?

If it's anything other than bamboo-mri-1.9.2, you'll need to type:

heroku stack:migrate bamboo-mri-1.9.2

and the redeploy.

clemens commented 13 years ago

Yeah, I'm running on bamboo with 1.9.2.

On 08.05.2011, at 22:13, sferik reply@reply.github.com wrote:

What Heroku stack are you running on?

If it's anything other than bamboo-mri-1.9.2, you'll need to type:

heroku stack:migrate bamboo-mri-1.9.2

and the redeploy.

Reply to this email directly or view it on GitHub: https://github.com/pedro/rails3_serve_static_assets/issues/1#comment_1120127

clemens commented 13 years ago

I've tried using this as a plugin and manually changing it to use the new API. The app can then start up but I keep getting 500s because of SystemStackErrors. The interesting part is that Heroku keeps telling me that Rails is not configured to serve static assets although I've adapted the production config and I've double checked that Rails is in fact running in the production environment.

mathieulegrand commented 13 years ago

with the following config/environments/production.rb: https://gist.github.com/962259 and the following Gemfile: https://gist.github.com/962252 and bamboo-mri-1.9.2 in heroku info, I am able to deploy to Heroku just fine:

-----> Heroku receiving push
-----> Rails app detected
-----> Configure Rails 3 to disable x-sendfile
       Installing rails3_disable_x_sendfile... done
-----> Configure Rails to log to stdout
       Installing rails_log_stdout... done
-----> Gemfile detected, running Bundler version 1.0.7
clemens commented 13 years ago

Thanks, Mathieu. That solved the problem with static assets. I've now also managed to find the problem with the SystemStackError: I was using i18n fallbacks manually and the Rails setting somehow caused infinite recursion ... :-(