-
Notifications
You must be signed in to change notification settings - Fork 179
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
uninitialized constant Tailwindcss (NameError) when launching puma #319
Comments
my puma.rb
Gemfile
|
"bundle env" returns Environment
Bundler Build Metadata
Bundler settings
GemfileGemfilesource "https://rubygems.org"
git_source(:github) { |repo| "https://github.com/#{repo}.git" }
ruby "3.1.2"
# Bundle edge Rails instead: gem "rails", github: "rails/rails", branch: "main"
gem "rails", "~> 7.0.8"
# The original asset pipeline for Rails [https://github.com/rails/sprockets-rails]
# Use postgresql as the database for Active Record
gem "pg", "~> 1.1"
# Use the Puma web server [https://github.com/puma/puma]
gem "puma"
# Use JavaScript with ESM import maps [https://github.com/rails/importmap-rails]
gem "importmap-rails"
# Hotwire's SPA-like page accelerator [https://turbo.hotwired.dev]
gem "turbo-rails"
# Hotwire's modest JavaScript framework [https://stimulus.hotwired.dev]
gem "stimulus-rails"
# Build JSON APIs with ease [https://github.com/rails/jbuilder]
gem "jbuilder"
# Use Redis adapter to run Action Cable in production
gem "redis", "~> 4.0"
# Use Kredis to get higher-level data types in Redis [https://github.com/rails/kredis]
# gem "kredis"
# Use Active Model has_secure_password [https://guides.rubyonrails.org/active_model_basics.html#securepassword]
# gem "bcrypt", "~> 3.1.7"
# Windows does not include zoneinfo files, so bundle the tzinfo-data gem
gem "tzinfo-data", platforms: %i[ mingw mswin x64_mingw jruby ]
# Reduces boot times through caching; required in config/boot.rb
gem "bootsnap", require: false
# Use Sass to process CSS
# gem "sassc-rails"
# Use Active Storage variants [https://guides.rubyonrails.org/active_storage_overview.html#transforming-images]
# gem "image_processing", "~> 1.2"
gem "devise"
gem "autoprefixer-rails"
gem "font-awesome-sass", "~> 6.1"
gem "simple_form", github: "heartcombo/simple_form"
gem "sassc-rails"
group :development, :test do
gem "dotenv-rails"
# See https://guides.rubyonrails.org/debugging_rails_applications.html#debugging-with-the-debug-gem
gem "debug", platforms: %i[ mri mingw x64_mingw ]
end
group :development do
# Use console on exceptions pages [https://github.com/rails/web-console]
gem "web-console"
# Add speed badges [https://github.com/MiniProfiler/rack-mini-profiler]
# gem "rack-mini-profiler"
# Speed up commands on slow machines / big apps [https://github.com/rails/spring]
# gem "spring"
end
group :test do
# Use system testing [https://guides.rubyonrails.org/testing.html#system-testing]
gem "capybara"
gem "selenium-webdriver"
end
gem "tailwindcss-rails"
gem "pry-byebug", "~> 3.10"
gem "rqrcode", "~> 2.2"
gem "sprockets-rails", "~> 3.4" Gemfile.lock
|
sassc-rails cannot be used with tailwindcss-rails. Maybe that's why it happens |
Thanks, that solved the problem! |
The problem is back somehow, maybe it was not solved after all. Not going to reopen it just yet because I want to make sure I didn't miss anything. bundle exec puma
Gemfile
Gemfile.lock
bundle env Environment
Bundler Build Metadata
Bundler settings
GemfileGemfilesource "https://rubygems.org"
git_source(:github) { |repo| "https://github.com/#{repo}.git" }
ruby "3.1.2"
# Bundle edge Rails instead: gem "rails", github: "rails/rails", branch: "main"
gem "rails", "~> 7.0.8"
# The original asset pipeline for Rails [https://github.com/rails/sprockets-rails]
# Use postgresql as the database for Active Record
gem "pg", "~> 1.1"
gem "tailwindcss-rails", "~> 2.3"
# Use the Puma web server [https://github.com/puma/puma]
gem "puma"
# Use JavaScript with ESM import maps [https://github.com/rails/importmap-rails]
gem "importmap-rails"
# Hotwire's SPA-like page accelerator [https://turbo.hotwired.dev]
gem "turbo-rails"
# Hotwire's modest JavaScript framework [https://stimulus.hotwired.dev]
gem "stimulus-rails"
# Build JSON APIs with ease [https://github.com/rails/jbuilder]
gem "jbuilder"
# Use Redis adapter to run Action Cable in production
gem "redis", "~> 4.0"
# Use Kredis to get higher-level data types in Redis [https://github.com/rails/kredis]
# gem "kredis"
# Use Active Model has_secure_password [https://guides.rubyonrails.org/active_model_basics.html#securepassword]
# gem "bcrypt", "~> 3.1.7"
# Windows does not include zoneinfo files, so bundle the tzinfo-data gem
gem "tzinfo-data", platforms: %i[ mingw mswin x64_mingw jruby ]
# Reduces boot times through caching; required in config/boot.rb
gem "bootsnap", require: false
# Use Sass to process CSS
# gem "sassc-rails"
# Use Active Storage variants [https://guides.rubyonrails.org/active_storage_overview.html#transforming-images]
# gem "image_processing", "~> 1.2"
gem "devise"
gem "autoprefixer-rails"
gem "simple_form", github: "heartcombo/simple_form"
group :development, :test do
gem "dotenv-rails"
# See https://guides.rubyonrails.org/debugging_rails_applications.html#debugging-with-the-debug-gem
gem "debug", platforms: %i[ mri mingw x64_mingw ]
end
group :development do
# Use console on exceptions pages [https://github.com/rails/web-console]
gem "web-console"
# Add speed badges [https://github.com/MiniProfiler/rack-mini-profiler]
# gem "rack-mini-profiler"
# Speed up commands on slow machines / big apps [https://github.com/rails/spring]
# gem "spring"
end
group :test do
# Use system testing [https://guides.rubyonrails.org/testing.html#system-testing]
gem "capybara"
gem "selenium-webdriver"
end
gem "pry-byebug", "~> 3.10"
gem "rqrcode", "~> 2.2"
gem "sprockets-rails", "~> 3.4"
gem "pundit", "~> 2.3" Gemfile.lock
|
Try to start Rails with |
The server then launches, but for some reasons there are large parts of the tailwind classes missing. For example |
Are you sure that this problem doesn't occur if you start |
yes, I have that running in a separate terminal window |
I also cannot find a pattern to the missing classes. I have tried deleting the assets and rebuilding them but it always ends up with some missing stuff. |
/app/assets/builds/tailwind.css contains "blue" exactly once, which seems very strange
|
Maybe there's some problem with relative paths when running it this way. It's just a theory that I have not corroborated. |
Should I open a separate issue for it? |
I think reopening this is enough. But before that, could you try running Tailwind in a main Rails app without additional gems to the default ones in the Gemfile? To be sure it's not a conflict |
At least for the example above I found the problem. The just in time compiling that tailwind uses scans view files for classes and then adds those to the builds css file. I was using some rails specific logic which isn't covered by that. aka stuff like Thanks for your help @brunoprietog! |
When launching my development server locally with "bundle exec puma"
It fails with the following error.
(I assume it's a configuration error on my side, but I followed the installation instructions directly)
The text was updated successfully, but these errors were encountered: