Closed mehmetaydogduu closed 4 years ago
You’ll need to be more specific. All looks good from our side.
On Thu, Mar 19, 2020 at 2:02 PM Mehmet Aydogdu notifications@github.com wrote:
It is not working. Operation needed.
— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/tenex/rails-assets/issues/465, or unsubscribe https://github.com/notifications/unsubscribe-auth/AACYZSCKPPFQZQ4SFZTUSB3RIJM4XANCNFSM4LPPJI3A .
Did you check https://rails-assets.org/status page?
Every build fails.
@joshjordan, @tenex, @hut8: also the search engine fails https://rails-assets.org/#/?query=bootstrap
In fact seems to be quite broken.
If you need a temporary solution to download gems and avoid relying on the site (since maintenance issues could mean downtime, or getting hacked), here is one.
First, run bundle package
.This will create a vendor/cache
folder with all your gems as .gem
files.
Do not commit there, because each time bundle install
runs, it will vendor everything (and this means a lot of volume for some gems e.g. nokogiri
).
Instead (as discovered on https://stackoverflow.com/a/12391024/20302):
mkdir -p vendor/gems-backup/gems
cd vendor/gems-backup
gem generate_index
source 'https://rails-assets.org' do
# SNIP
end
by
source "file://" + File.expand_path('vendor/gems-backup') do
# SNIP
end
This will buy you some time until you can move your app to e.g. webpack or another solution.
Sadly, this will put an absolute path in Gemfile.lock
!
I finally had to use good old path:
and unpack into a subfolder of the same git repo, as a work-around.
How we can repair it?
Since it looks like this project is going to be dead, what would be your recommendations to move out of it? webpack? Any easy transitions?
Not dead, but also experiencing a very low ratio of requests for broken functions vs. serving stable bower packages day to day. Pull requests eagerly accepted for search and the set builds that are not currently working.
With that said, we have always recommended that folks use rails-assets.org sparingly and as a transition path to a stronger tool like webpack. Webpack is now integrated directly into Rails and bower has drastically dropped off in favor of npmjs as a canonical package repository.
@Silex you do not have to jump to webpack
right away if you don't really need it (especially given the number of dependencies this will bring).
You can use yarn
on its own (the default for Rails, so this provides a more future-proof path to upgrade later to webpack
if the assets pipeline is removed for good), and move your "Rails assets" dependencies to yarn
, then add this to config/initializers/assets.rb
:
Rails.application.config.assets.paths << Rails.root.join('node_modules')
# I also had to do:
if Rails.env.development?
# Re:
# - https://github.com/rails/sprockets-rails/issues/458
# - https://github.com/rmosolgo/graphiql-rails/issues/75
Rails.application.config.assets.precompile += %w(application.css application.js)
end
Do this move to yarn
dependency by dependency, and you will have to look inside the node_modules
folder to figure out how to adjust your app/assets/javascripts/application.js
and css.
It could look this way:
- //= require bootstrap
+ //= require bootstrap/dist/js/bootstrap
- //= require knockoutjs
+ //= require knockout/build/output/knockout-latest.js
(depending on the actual paths you have in your dependencies)
Finally, you will have to install yarn
(and nodejs) on your server for deployment, too.
Migrating to webpack
is this + a bit more work (or lot of work, depending on your specific app!).
Hope this helps!
@thbar: thanks. I should have specified I just want the convenience, rails-assets was great but as @joshjordan maybe I shouldn't have used it in the first place.
Here's what I currently use:
source 'https://rails-assets.org' do
# Datatables
gem 'rails-assets-datatables'
gem 'rails-assets-datatables-buttons'
gem 'rails-assets-jszip'
gem 'rails-assets-pdfmake'
# Blueimp gallery
gem 'rails-assets-blueimp-gallery'
# Lazy loading
gem 'rails-assets-jquery-lazy'
# Touch events
gem 'rails-assets-jqueryui-touch-punch-improved'
# Moment & strftime
gem 'rails-assets-moment-strftime'
# Clipboard
gem 'rails-assets-clipboard'
# Color picker
gem 'rails-assets-jquery-minicolors'
end
I'll follow your yarn recommendations and wait for rails to take a stable direction reguarding webpack/asset pipeline as you suggested.
@Silex if you need an even quicker solution, check out my previous comment at https://github.com/tenex/rails-assets/issues/465#issuecomment-608418564 (but this won't allow you to upgrade the packages, it will just work as a temporary measure until you move to yarn
or webpack
in full).
@thbar: rails-assets still works at the moment, only the website is broken so I don't need to move quickly, but I don't want to rely on unmaintained software so I will move to yarn/whatever in the future.
@Silex it works at the moment, but expect some downtime from time to time (note: I'm not bashing the maintainers in any way - this stuff is hard without resources & time!). It is up to you to appreciate if "impossible to deploy" is something you can safely live with, depending on your context ;-)
@thbar: yeah, by not quickly I meant "not right now, but before the next release" ;-)
amazing sad situation, nobody fixes the site
@fastengineer Pull requests welcome
@fastengineer Pull requests welcome
Yes I consider but there is no contributing guide. Also I need test database.
For the record switching to yarn was pretty easy. My list above became:
{
"dependencies": {
"blueimp-gallery": "^2.44.0",
"clipboard": "^2.0.6",
"datatables.net": "^1.10.21",
"datatables.net-bs": "^1.10.21",
"datatables.net-buttons": "^1.6.2",
"datatables.net-buttons-bs": "^1.6.2",
"datatables.net-buttons-dt": "^1.6.2",
"jquery-lazy": "^1.7.10",
"jquery-minicolors": "^2.1.10",
"jquery-ui-touch-punch": "^0.2.3",
"jszip": "^3.4.0",
"moment": "^2.26.0",
"moment-strftime": "^0.5.0",
"pdfmake": "^0.1.65"
}
}
And I then had to adapt a lot of includes to fit the new scheme, which was a bit annoying but ok. It's a shame that these packages don't decide on a convention, sometimes it's /js
, sometimes it's /dist
, and sometimes you can just require the directory if there's a bower.json
(which tells Sprockets where the js/css are).
Closing this without any communication is not ideal, especially since the site is still broken.
As I said, pull requests are welcome. It causes confusion to have an “app broken” thread here when there are actual breakages or suspected breakages. As it stands, the application is currently serving several hundred thousand bundle requests for millions of packages without errors.
I think you should rename the issue to "website broken (but packages installation working)" and let it open instead.
Or is there another issue tracker dedicated to the website that we are missing?
Closing this issue will only result in people reopening another issue to mention the website is broken, you'd let them find this issue instead.
It is not working. Operation needed.