jazz_hands gem breaks history in rails console - ruby-on-rails

I've started using jazz_hands to make my Rails console more useful, but now line/history editing is broken. When I run over the end of the line (ie, wrap), or use up arrow to go into history, the output is garbled.
Terminal settings are fine for everything else, Ubuntu 12. Any ideas? I'm hoping it's something simple and I'm not the first developer to bump into this, but there's nothing in the FAQ, or in the various related Gems (pry etc), and I'm loathe to raise a bug on the project until I check this isn't a well known issue.

It's fixed in the latest update, but here's a few workarounds if for some reason you can't update.
https://github.com/nixme/jazz_hands/issues/1

Related

Ruby on Rails link generated with link_to helper no longer works in Chrome

Chrome has been making a lot of changes recently, and one of them has broken a code statement I use to retrieve a document stored in a database, related to a parent record. The action to upload the file and create the attachment relationship is working, so my users can still add documents. They can no longer download and view stored document attachments. The code is using the link_to helper method, and appears to be building the link correctly, verified by the fact that it still works using Edge, so my users have an ugly workaround, but I need to understand what is happening. I have confirmed that it is indeed Chrome that is the problem, because at first I couldn't recreate the defect in development (until I updated my Chrome browser to current version.) Now I can recreate the defect in my development environment.
When the link in my form is clicked, Chrome displays an error screen with this text:
This page isn't working
(*localhost*) sent an invalid response
net::ERR_RESPONSE_HEADERS_MULTIPLE_CONTENT_DISPOSITION
If I extract the link using developer tools and try and execute it in an empty browser window, I get the same error.
The link is constructed like this:
(*name of the file attachment*)
Before you ask, yes, I have confirmed there are no commas or quotes in my file names! lol
I am hoping someone somewhere can point me to a solution, hopefully simple, maybe obvious, that I can use to get my web form to play nicely with Chrome again - application code change, web server configuration (I am running on RHEL7 Apache in production and Puma in development, my database is Oracle, and I am building with Ruby 2.3.6 and Rails 5.1.5, along with many many gems).
I hope I have covered all the relevant points. Thank you for taking the time to read this post!
Issue has been resolved by upgrading gem attach to version >= 1.0.5. Many thanks to the gem author for excellent responsiveness.

Issue with Rails Generator Building a Plugin

I am building a Rails plugin for an application at work.
I want to extract logic that was used in multiple locations, but implemented slightly differently, and add new features needed without doing it 2-3 times over.
I've never build a gem, but according to what I was reading it is possible to use rails generate.
However this has not been the case for me.
Running rails g model Something stuff:type:
First interesting thing is that it is generating mini test stuff when I explicitly told the plugin not to use mini test (using Rspec).
Then looking in my folder structure for the plugin, no db/ folder, nothing added to app/models/, and no test/ folder:
Running the command a second time reveals to me that the files are indeed created:
My questions are:
Where is this stuff going? Can I even find out?
Has anyone encountered something similar? Is it due to a misconfiguration, or bug? Essentially, what's happening?
I would truly appreciate any advice or suggestions!
EDIT #1
Forgot to mention that I checked within the spec/dummy application in case things were being created there, and it is still empty as I left it.
EDIT #2
So I found where the files were by using the find command:
And yeah it added the files to my home folder...
At least now I can just paste them in the right location, but obviously this is bizarre and I'd like to get this resolved, figure out what is going on.
Okay so turns out that yes you may use Rails Generators when building a gem. Also, the generated files will not be placed inside the dummy application unless you are in that directory.
Everything is working as expected on a different computer.
That stuff is going into dummy app that is usually located in test/dummy. In your case, it seems to be located in specs/dummy.
Yeap and nope. That's not misconfiguration.

Upgrading bootstrap-sass from v2.3.2.0 to v3.0.2.1 breaks sample_app CSS

Working through Hartl's sample_app tutorial...not an issue with the tutorial, but with my own tinkering. Wondering if someone smarter than me can help us all out... I know that often times updating gems can bork your app(s), so I was prepared for this (hooray for committing often!), but when I saw that the bootstrap-sass gem I was using was out-of-date, I had to update.
Before the update, I was using v2.3.2.0 - no ill side effects.
After the update, the gem version was 3.0.2.1 and certain sass variables had changed, which was an easy fix (namely cameCase to non-camel-case). This was easily identified and fixed by running the rspec tests written to this point in the tutorial.
What's throwing me through the loop is now the right top menu links (home, help, sign in) look stacked like a "normal" un-styled un-ordered list. Correspondingly, this is causing the top bar to triple in size, and thus cover some of the text seen in the main content area.
I'm not a talented enough front-end guy to know exactly what is going on, but have tried to describe it as best as I can here. I can point you to the git commit compare here, but even this is a lot to take in.
In the meantime, I've reverted to v2.3.2.0 and all is back to how it was. Lesson learned, sniff out changes and test-test-test before blindly updating gems.
Thanks in advance for any and all help!
P.S. I also have posted this in the /r/Learn_Rails subreddit here.
For a list of what is different between BS 2.x and 3.x see this link: http://getbootstrap.com/getting-started/#migration
If you want to use the latest BS version, you'll have to update the HTML to reflect the new class names etc.
This is happening because of the new functionality introduced in the newer version of Bootstrap(3.0) and tutorial is based on the bootstrap verison(2.3..).
So, If you are interested then see the changes made in the newer versions Click Here

Twitter Bootstrap displays strange on local machine, fine in production

I've got a strange problem. My rails app looks fine in prod, but I recently started working on it on a different computer, and the front page seems to have forgotten about it's margins. When I commit everything and push it out to production, there are no problems.
I'm using twitter-bootstrap-rails and have not customized the stylesheets at all.
This picture has everything crammed against the left side of the browser, on my local machine
This picture shows production, where everything is properly aligned
This could be due to the mode you are running the server. My guess is that you will see the difference when you run rails s development vs rails s production.
I ran into this before, and it was an issue where my CSS was compiling incorrectly because I had some bad CSS floating around.
It can be pretty insidious to track down, so first look through your assets hierarchy and look for anything that is out of place. After that, you'll have to investigate using a browser and inspection tools like through Chrome.
Had similar issues with the fixed header bar which lost it's style. Looks like it was the update to the twitter-bootstrap-rails gem from 2.0.3, which I was using to the new 2.1.6.
With the update I then got an error about twitter-bootstrap-rails v2.1.6 break with error "rails app: method_missing': undefined methodless'
There has been a lot of discussion on the twitter-bootstrap-rails issue list: see v2.1.6 breaks app which explains a lot of the revised Gemfile configurations.
So far applying the suggestions hasn't resolved my issue of the header bar, which was dark, as per the Twitter Bootstrap examples, now appearing with a grey background like the LH nav bar. Suspect that it's something to do with the less compiling or linking of the assets.
I'm not sure exactly what the problem was still, but once I linked the app to Pow on my Mac everything displays normally. Strange. Anyway, I'm not having a problem anymore.

Rails app unable to save anything after deployment

today I uploaded my app to server, and after seting it into development mode, and running of course rake tasks (rake db: migrate, and rade db: migrate RAILS_ENV="production") and well it just doesn't save anything.
The problem happens when I try to create any new items, it just goest to the listing of models...
Your question is very vague. I believe you're saying the app writes files to the server's hard drive. If that's what you're asking, I think the best guess is that something's wrong with file system permissions. Unfortunately, I can't say what is wrong without more details.
i solved it.
reason i asked was because i absolutely went through each and every one of my potential problems and took care of them, and well in the end none of them were the reason of such a failure. so then i went to the basics
and i basically had to clone my development environment on the production machine.
so i had to downgrade rails a couple of versions, and some gems too.
that took care of it, everything went on smoothly, so if anyone ever encounters such mysterous failures, give this a try.

Resources