Skip to content

Commit 64c40e1

Browse files
committed
Figuring out things
1 parent ffcd70e commit 64c40e1

File tree

4 files changed

+14
-3
lines changed

4 files changed

+14
-3
lines changed

README.md

+13
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,10 @@ config.rails_lineman.lineman_project_location = "my-lineman-app"
2828

2929
Alternatively, rails-lineman will look for an environment variable named `LINEMAN_PROJECT_LOCATION`.
3030

31+
Note that to prevent your Lineman JavaScript & CSS from being loaded twice in production, you'll need
32+
to remove the `require_tree .` directives from `app/assets/javascripts/application.js`
33+
and `app/assets/stylesheets/application.css`.
34+
3135
### the Lineman side
3236

3337
Just add the [lineman-rails](https://github.com/testdouble/lineman-rails) plugin to your project:
@@ -110,6 +114,15 @@ Such that the `public/assets` folder looks like:
110114
└── manifest-c468cd8d56c4364af6110bc39b00ed40.json
111115
```
112116

117+
Note that in Rails 4, Rails will by default not serve any static assets out of
118+
`public/assets` when running in the production environment (leaving that up to
119+
Apache/nginx). To verify this is all working you may need to configure in
120+
`config/environments/production.rb`:
121+
122+
``` ruby
123+
config.serve_static_assets = true
124+
```
125+
113126
## Heroku
114127

115128
Somewhat humorously, rails-lineman will actually try to detect whether it's running on Heroku

app/assets/javascripts/application.js

-1
Original file line numberDiff line numberDiff line change
@@ -13,4 +13,3 @@
1313
//= require jquery
1414
//= require jquery_ujs
1515
//= require turbolinks
16-
//= require_tree .

app/assets/stylesheets/application.css

-1
Original file line numberDiff line numberDiff line change
@@ -9,5 +9,4 @@
99
* compiled file, but it's generally better to create a new file per style scope.
1010
*
1111
*= require_self
12-
*= require_tree .
1312
*/

config/environments/production.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
# config.action_dispatch.rack_cache = true
2121

2222
# Disable Rails's static asset server (Apache or nginx will already do this).
23-
config.serve_static_assets = false
23+
config.serve_static_assets = true
2424

2525
# Compress JavaScripts and CSS.
2626
config.assets.js_compressor = :uglifier

0 commit comments

Comments
 (0)