Eric
Eric

Reputation: 2265

Rails: How do I do bundle clear?

I inherited a Rails 3.1 app, served by passenger/nginx.

I thought I had to upgrade from ActiveAdmin 0.4 to 0.5, but that caused other problems, so I found a workaround and downgraded to 0.4.0.

Then Ruby started complaining that the formtastic-bootstrap gem wasn't checked out. Here's the line in the Gemfile:

gem 'formtastic-bootstrap',   :git => "git://github.com/cgunther/formtastic-bootstrap.git", :branch => "bootstrap-2"

And there certainly was a f-b gem in the config, but then someone on stackoverflow said to run

bundle install --deployment

and after I ran that incantation, the site loaded. Except all the ActiveAdmin CSS is gone. I can make small mods to the file assets/active_admin.css and they take effect, but the site otherwise looks like times roman crap.

So I did something bad during one of the above steps -- I normally run bundle install as root, but the site is owned by 'web'. And after Ruby complained that it couldn't find formtastic-bootstrap, I found two of those gems installed in /home/web/.bundler/ruby/ (or something like that), and because Ruby must have been complaining about them, I deleted them. There wasn't anything else there.

After running another bundle install, the site would then load, but the CSS wasn't taking effect.

I loaded up the reference site in a different tab, and compared the HTML I've generated with the reference HTML. The only difference is in the two lines that load the JS and CSS. In the reference site:

<link href="/assets/active_admin-e1b0dc3ef3753e264638b07b12174adb.css" media="all" rel="stylesheet" type="text/css" />
<script src="/assets/active_admin-385197d3f18a204049d4eb22bc9a033e.js" type="text/javascript"></script>

In mine:

<link href="/assets/active_admin.css" media="all" rel="stylesheet" type="text/css" />
<script src="/assets/active_admin.js" type="text/javascript"></script>

I know the JS and CSS are being loaded, because I see the alert, and other things get colorized, just not the ActiveAdmin elements. But the DOM inspector shows that the reference site is pulling all sorts of things out of that CSS file for the body element, while for my page, it's only pulling generic style rules out of resource://gre-resources/html.css and a data URI that doesn't need repeating here.

The Error Console is full of the usual jquery and google.maps JS admonitions (it's a gmap app), but nothing jumps out.

Does this ring a bell for anyone? I gather the reason why I'm seeing untagged CSS and JS file references is because of that "bundle install --deployment" I ran, followed by "bundle install --no-deployment" when things got worse. I just want to set things back to square 1.

So how can I just clear everything? Or better still, is are there a bunch of magic doodads being cached somewhere?

Upvotes: 0

Views: 11023

Answers (1)

muttonlamb
muttonlamb

Reputation: 6501

You could try doing a bundle uninstall

another possibility is to rename the Gemfile.lock and rerunning bundle install, this will force a full re-install.

If you are using version control, such as Git, you could run a diff and see what changes have been made to the code and comparing.

Upvotes: 1

Related Questions