Paperclip / Windows7 / Rails 3.1 "Identify" issue... no posted solutions working. How do i fix this or get more information? - paperclip

I'm having the common " is not recognized by the 'identify' command." error using paperclip and rails 3.1 on my windows dev machine. This is a win7/64 system with ImageMagick-6.7.3-0-Q16-windows-x64-dll.exe installed at c:\ImageMagick.
I've tried all of the solutions listed under at https://stackoverflow.com/search?q=%5Bpaperclip%5D+identify and it keeps giving me the same answers.
Paperclip.options[:command_path] = "C:/ImageM~1" is in my config/enviroments/development.rb
and
Paperclip::Attachment.default_options[:command_path] = "C:/ImageM~1" is the contents of my config/initializers/paperclip.rb
I can use identify at the command prompt...and that is working fine. It seems like no matter what i do, it keeps throwing the same error.
link.rb
has_attached_file :artwork,
:styles => {
:thumb=> "100x100#",
:small => "150x150#" }
_form.html.erb
<%= f.file_field :artwork %>
please help. i am out of options. anything else i should try or anywhere to get more information as to where this is failing?
UPDATE
i've removed the ':style => .....' attributes in the model and it now works. i guess it's just straight imagemagick messing up. i don't get it. i can type 'identify' in the console, it works fine, then i run 'rails s' in the same console. there were references to a quotes related issue, but according to the paperclip docs on github, that was sorted when Cocaine was implemented.

Installing RMagick and Imagemagick following these articles fixed it!
This is the article that actually solved the problem:
http://rails.webintellix.com/2010/01/04/how-to-install-rmagick-imagemagick-on-windows/
Basically, installing the RMagick win32 binary sorted the 'identify' issue...
This one got close and has some good info, but didn't actually fix it for me.
http://www.waydotnet.com/blog/2010/02/rmagick-on-ruby-1-9-1-i386-mingw32-work-d/

Related

TestFirst.org Learn_ruby rake and depreciation warnings :should and :expect syntax

After many searches via Google I'm ready to get some input from the community. I'm trying to apply for App Academy in San Francisco and one of the required pre-work is TestFirst's Learn_ruby. I original had this configured on a Linux VM on my windows box. It worked very well. When I ran rake it would list one problem at a time; the text was is helpful colors; and the output was very condensed so I only got what I needed to read. I've recently wiped and configured my system as a dual boot Xubuntu 14.04/ Windows and the VM I once had is long gone. I worked to get Ruby setup in my linux vm just as I had done in the VM.
My problem now is when I run rake on my projects I get the same depreciation warning:
Deprecation Warnings:
Using should from rspec-expectations' old :should syntax without
explicitly enabling the syntax is deprecated. Use the new :expect
syntax or explicitly enable :should instead. Called from
/home/kaji/Projects/learn_ruby/05_silly_blocks/silly_blocks_spec.rb:25:in
`block (3 levels) in '.
After googling this back and forth I understand for the most part what the error is telling me. And I've even found a solution to get it to go away. Thanks to this post: RSpec's New Expectation Syntax, I was able to find a syntax to make the warning go away. (basicly had to change blah.should == # to expect(blah()).to eq(#) inside the *_spec.rb file. This seems to make the warning happy. However I still see signs that I have another problem.
The output isn't as 'friendly' as it was when I was on my VM. It's not in color; it dumps all the errors at once. What I enjoyed the most about learn_ruby was it gave me one objective at a time with minimal output. Now i have to scroll up quite a ways just to see what my issues are.
I've tired removing RVM completely and all gems and reinstalling to see if I could resolve this. No dice. I'm such a Ruby Noobie i'm a little overwhelmed with all this. I'd like to just get back to learning the basics but this has been troubling me for over a week. Has anyone had this problem/fix the except
I've also tried removing the rpsec ~<=2.0 from the Rakefile. I'm using ruby -v 2.1.2, rails 4.1.1 and i have RSpec 3.0.0, 2.99.0, 2.0.0. I even tried finding a tutorial on changing the syntax but it was real confusing as it introduced lots of Ruby concepts I have no idea on. At that point I feel like I'm over my head and there is something simple I'm missing.
Hope I provided enough info for assistance.
I hope I'm answering the correct question, since you seem to have figured out the one in the title (i.e. the preferred syntax having changed from blah.should to expect(blah).to). It would help if you changed the title to reflect the actual question.
RSpec.configure do |config|
config.fail_fast = true
config.color_enabled = true
}
will make RSpec fail at first error, rather than after running all tests, and enable the colours, for that one file.
Or you can run rspec with rspec --fail-fast --color.
Alternately, you can put this in $HOME/.rspec so it always does it:
--fail-fast
--color

Octopress - Generating blank files

Asked this on superuser.com, not sure if stackoverflow is a better suitable place for it, but I am not getting any answers yet:
===
I am trying to generate a new blog entry in my octopress setup, but I noticed that some previous posts are being generated as empty files in public, so are the new ones I am trying to generte.
There seems to be no difference at all between the markup files from one entry which is being properly generated to another that isn't
I've got two octopress installations, one's working and this one I am talking about isn't, updates octopress on both, reinstalled bundle but no luck, files as atom.xml are also not being generated correctly.
Also updated from ruby 1.9.2p290 to latest release from 1.9.3 but also did not difference.
Anyone's encountered this before?
===
This is most likely because you started using codeblocks. This was happening to me, and even posts/pages that didn't use codeblocks would fail to generate. My problem (on Windows) was that I didn't even have Python installed (thought I did). Installing it fixed the problem, then gave me another error, which was fixed by updating the pygments.rb (note .rb) gem. Doing these two things fixed all my problems.
There's a similar issue if you're on arch linux which defaults python to version 3 which isn't supported by pygments.rb yet. You'll have to look around to figure out how to fix that to use 2.7 instead, but it should be pretty straightforward.
Can you provide an example of: a) a post that doesn't generate correctly, and b) a post that does generate correctly?
I assume they are just individual posts (and not, for example, pages like /about/). I would also assume that they render as blank both in the blog index on your front page and on the individual post page.
Also - what does render? Is it rendering the rest of the page, but just without the "content" of the post itself? Or does the page not even exist? (404?)

How to use Pygments.rb on Heroku?

My app uses a gem (pygments.rb) for syntax highlighting which requires access to pygments lib.
I cant get it to work on heroku as Python is not part of the rails build pack.
Any help/ link on how to link pygments?
Thanks
P.S. I've looked at TrevorTurk's method but looks like its made for albino rather than pygments.rb
Does anyone know better method to check that we're on heroku?
if ENV['HOME'] == '/app'
require 'rubypython'
RubyPython.start(:python_exe => "python2.6")
end
I found the solution from the link below.

Google-Maps-For-Rails not showing map in Rails 3.1

I am trying to use the gem 'gmaps4rails'. I inserted all of the necessary code into my model and view, and I know that the geocoding is working. However, when I insert the code <%= gmaps4rails(#json) %> into my index.html.erb file, the map does not appear.
EDIT: I downgraded the version to 0.8.8, and I was able to run
rails g gmaps4rails:install to get the layouts. Does version 0.9.1 have a different command for installing the layouts?
I was having the same problem (couldn't get the generator installing) and getting the 404 for gmaps4rails.js.
The following steps worked (you had most of it).
I downgraded to 0.8.8;
ran the generator;
then copied the generated files from public/ to assets/;
changed back to version 0.9.1.
and it worked fine after that (i.e. map showing).

How do I recover from a broken gem?

I've recently started working on my first Sinatra/CouchDB app and kept running into a SystemStackError: stack level too deep error. After a ton of googling, I've discovered that one of the gems I've been using, json-1.4.3, is apparently broken :/
I uninstalled the gem, and installed json-1.4.2 instead, but I'm still getting the error. I'm wondering if I need to do something to make sure that 1.4.2 is being used now instead of the broken 1.4.3?
Any help would be greatly appreciated!
you can list the gems to see if you have two gems.

Resources