0

i am new in ruby on rails, i have done some modification in assets file ( like add a new image file default2.png,some style file has be changed and some javascript file also changed).

I have uploaded all file on the server in assets folder then tried to precompile all assets with the help of following command rake assets:precompile and also tried rake assets:precompile RAILS_ENV= production

after that css was not working properly check box is not visible, some images are not displaying in page.

we try to rollback the precompile file using these steps

  1. rm -fr public/assets
  2. rake assets:clean

again we tried the rake assets:precompile and rake assets:precompile RAILS_ENV= production.

Problem is not resolved, i had tried with below links

database configuration does not specify adapter

Rollback rake assets:precompile

rails 4 asset pipeline vendor assets images are not being precompiled

then got error **config.eager_load is set to nil. Please update your config/environments/*.rb fil es accordingly:

  • development - set it to false
  • test - set it to false (unless you use a tool that preloads your test enviro nment)
  • production - set it to true

rake aborted! ActiveRecord::AdapterNotSpecified: '' database is not configured. Available: ["d efault", "development", "staging", "production"] **

Community
  • 1
  • 1
  • Have you got a space between `RAILS_ENV=` and `production`? That could raise the `config.eager_load is set to nil` error. – Sebastian Oct 28 '16 at 16:33

1 Answers1

0

I was doing some mistake, if you want to add/edit new images, JavaScript and scss file in you are assets folders. you got same error then you have to do some changes...

  1. change you java script file extension like: main.js to main.js.rb
  2. change you scss style file extension like: custom_style.scss to custom_style.scss.rb
  3. compile below command rake assets:precompile and rake assets:precompile RAILS_ENV= production