Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fresh install fails #3648

Open
Andrew-Max opened this issue Sep 28, 2023 · 6 comments
Open

Fresh install fails #3648

Andrew-Max opened this issue Sep 28, 2023 · 6 comments

Comments

@Andrew-Max
Copy link

Andrew-Max commented Sep 28, 2023

Describe the bug
If I create a new rails 7 app and follow the install instructions, the application will not run. It fails with this error

Reproduction steps
Create a new rails 7 app and exactly follow the install instructions

Expected behavior
Installation works using the docs

Additional context

gem 'rails_admin', '~> 3.0'
gem 'sass-rails'
gem 'bootstrap', '~> 5.3.2'
gem "rails", "~> 7.0.8"
gem "sprockets-rails"

image

SassC::SyntaxError in RailsAdmin::Main#dashboard

Showing /home/amax/.rvm/gems/ruby-3.2.2/gems/rails_admin-3.1.2/app/views/layouts/rails_admin/_head.html.erb where line #19 raised:

Error: File to import not found or unreadable: rails_admin/src/rails_admin/styles/base.
        on line 2:1 of app/assets/stylesheets/rails_admin.scss
>> @import "rails_admin/src/rails_admin/styles/base";

@jotterlei
Copy link

@Andrew-Max check out this closed solution... https://github.com/railsadminteam/rails_admin/issues/3572#issuecomment-1327976864

I was getting the same issue and after updating my package.json file to include the rails_admin content, and running yarn build:css manually, I was able to move on.

package.json looks like this

...
"scripts": {
    "build:css": "sass ./app/assets/stylesheets/application.sass.scss:./app/assets/builds/application.css ./app/assets/stylesheets/rails_admin.scss:./app/assets/builds/rails_admin.css --no-source-map --load-path=node_modules"
  }
...

I also had to get my manifest.js file updated with

//= link rails_admin.css
//= link application-admin.css

@JWesorick
Copy link

I am running into this on a fresh install but running yarn build:css does not clear up the issue.

@JWesorick
Copy link

JWesorick commented Oct 25, 2023

Ok I missed some red output during rails g rails_admin:install:

You need to merge "scripts": {
  "build:css": "sass ./app/assets/stylesheets/rails_admin.scss:./app/assets/builds/rails_admin.css --no-source-map --load-path=node_modules"
} into the existing scripts in your package.json.
Taking 'build:css' as an example, if you're already have application.sass.css for the sass build, the resulting script would look like:
  sass ./app/assets/stylesheets/application.sass.scss:./app/assets/builds/application.css ./app/assets/stylesheets/rails_admin.scss:./app/assets/builds/rails_admin.css --no-source-map --load-path=node_modules

Correctly following those instructions fixed my issue.

@heratyian
Copy link

heratyian commented Nov 30, 2023

The installer adds a bunch of unnecessary files for rails 7 apps (yarn.lock, package.json, node_modules, rails_admin.js, etc) if you remove everything it generates except the config/initializers/rails_admin.rb and set asset delivery to sprockets it works fine out of the box.

@princetechs
Copy link

fixed for all here #3683

@arifikhsan
Copy link

Ok I missed some red output during rails g rails_admin:install:

You need to merge "scripts": {
  "build:css": "sass ./app/assets/stylesheets/rails_admin.scss:./app/assets/builds/rails_admin.css --no-source-map --load-path=node_modules"
} into the existing scripts in your package.json.
Taking 'build:css' as an example, if you're already have application.sass.css for the sass build, the resulting script would look like:
  sass ./app/assets/stylesheets/application.sass.scss:./app/assets/builds/application.css ./app/assets/stylesheets/rails_admin.scss:./app/assets/builds/rails_admin.css --no-source-map --load-path=node_modules

Correctly following those instructions fixed my issue.

sir you saved my life 😊

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants