Can't install imagemagick for rails on windows - ruby-on-rails

I am new to ruby on rails, and need an upload image and upload file control. I saw this (http://railscasts.com/episodes/134-paperclip) and it is what I need. But for the image resizing feature, it says it needs imagemagick.
I have been basically all day trying to install this, following multiple tutorials which are pretty much like this (https://github.com/rmagick/rmagick/wiki/Installing-on-Windows), or telling me to use the rmagick gem from rubyforge.org (which seems to be down since 2013).
When I follow the instructions I always get the following error when running gem install rmagick:
ERROR: Failed to build gem native extension.
Could not create Makefile due to some reason, probably lack of necessary libraries and/or header.
Could anyone please point me to an up to date tutorial or way of installing imagemagick? Or am I using something too old, I read on a post it has not been committed for years on github?
Also, if there is a better and easier way to upload files and images with rails, suggestions are welcome, as I don't HAVE to use paperclip and imagemagick.
Thanks

Finally got it installed.
I used version 6.7.9-9 and followed the second answer here (the one where it says to use the Ruby CMD and has some ** in the paths): Ruby on Rails RMagick on Windows 7

Related

How is jekyll related to ruby?

I have a pretty general question regarding Jekyll. When I try to install it on my mac I get an error saying I don't have write permissions to the ruby directory. After looking around online I've found that you can fix this by installing a ruby version manager. My question is why does this work? Is Jekyll essentially an extended version of Ruby? How are they related architecturally?
Thanks!
I think Jekyll is a Ruby Gem. So that would mean it is written in Ruby, and needs the Ruby interpreter on your system to install/run it.
RVM is just a tool to help you manage your different Ruby versions (because you could potentially install multiple versions at the same time, for different users for example).
Jekyll is built in Ruby and is available as rubygem. That's why it requires Ruby to build. It provides command line interface to carry out deploy and other operations and provides minimalistic HTTP server.
It is also equipped to convert markdown to HTML using redcarpet ruby gem.
It's AWESOME.

Trying to get Ruby/Rails installed on OSX Mountain Lion

This is my first question please be nice.
I've been trying to get my hands dirty with ruby/rails for a small coding project. I have Mountain Lion, and have been trying to use various techniques i've found on stackoverflow, and across the interwebs. It's not going so great! Nothing works of course. I have the system version of Ruby (1.8.7) as of now, and a bunch of broken junk from trying and failing to install Ruby!
When I install Rails via gem install, it sat for awhile... I finally learned to use -V, and noticed everything was returning back 302, and this takes forever, and finally it installs -- I get this output when I try to run rails -v
/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/rubygems.rb:230:in `activate': can't activate rack (~> 1.4.5, runtime) for ["actionpack-3.2.13", "railties-3.2.13"], already activated rack-1.5.2 for ["rack-ssl-1.3.3", "railties-3.2.13"] (Gem::LoadError)
It looks like some dependencies are broken? Anyhow I'm now trying to use RVM now to get another version of ruby and setup grails with brew, This is telling me that I need a newer version of ruby to install anything pretty much?? Here is the output.
rvm install 1.9.2-head
Installing requirements for osx, might require sudo password.
Skipping brew update make sure your formulas are up to date.
Cowardly refusing to continue, please read 'rvm autolibs'.
To proceed rvm requires a ruby-1.9|ruby-2 compatible ruby is installed.
We attempted to install ruby automatically but it failed.
Please install it manually (or a compatible alternative) to proceed.
-- I am getting os frustrated here, please throw me a bone and help me out --- If I have to have to I'll setup a linux vm just to get rails running -- yet I prefer working on my mac.
Please any advice?? I just want a working version of Rails 3 on my Mac this is allThanks in advance
Please go through www.railsinstaller.org for detailed installation and setup process. This guide should answer all of your questions.
Have you tried this tutorial http://net.tutsplus.com/tutorials/ruby/how-to-install-ruby-on-a-mac/
The tutorial includes all the errors you may come across during the installation.
According to this tutorial Ruby on Rail comes with the mac out of the box.
Have you tried JewelryBox? It provides a painless install method for rvm and a great little gui that helps you monitor the size of your gem sets, and installs of ruby. Along with helpful reminders to upgrade rvm. I resisted at first using it, because using a GUI made me feel like a noob, but it really is a great little tool, that makes for super easy installs of ruby, and rvm, and consequently rails.
http://jewelrybox.unfiniti.com/

How can I uninstall ruby on rails completely on Windows (installed using RailsInstaller)?

I'm a complete beginner to ruby on rails and am just following a tutorial on Skillshare. I installed rails on Windows 7 following the instruction, but have been having issues.
I'd like to uninstall it completely and start fresh.
I saw some posts related to this, but commands like gem uninstall rails don't work because I'm not sure which folder I should be in when I type in that command.
Also, the tutorial is being done in Mac so I'm having trouble following it exactly.
Please let me know if there's a way to uninstall rails (installed using railsinstaller). Thanks a bunch!
You can uninstall it from Program and Features in Control Panel. After that you can remove the directory to which you installed it. If you didn't change it, then it is C:\Program Files(x86)\Railsinstaller
However, refreshing the software installation is just about the extreme step. What issues are you experiencing? You can comment or add those to your questions.

need help installing ruby on rails

I'm installing 1.87.
I got ruby installed and ruby gems
then I tried this from the command prompt: gem install rails
and it gave me this error: http://screencast.com/t/wmBr2b1vC5I
I got the devkit like it suggested and put it in a directory on my desktop but when I went to github for instructions I got lost.
Can someone help guide me step by step? I'm used to PHP and MySQL using WAMP so running things from the command line is new to me.
A lot of gems require native code to be built and linked to as they're being installed. Unfortunately, Windows does not provide any compiling and linking tools, so you have to take one of several routes to enable building native code in Ruby gems.
I've always used Cygwin in the past to accomplish this, but there's also the Ruby Installer which may benefit you more.
Ruby Installer: http://rubyinstaller.org/
You'll probably need to remove your current Ruby install before running the installer, but it should give you everything you need to make installing Rails possible.
If you don't want to use the full installer, you can download "Development Kit", which is part of the installer, to just add the necessary build tools to your command-line environment.
Development Kit: https://github.com/downloads/oneclick/rubyinstaller/DevKit-tdm-32-4.5.2-20111229-1559-sfx.exe

Can't install Rmagick and Imagemagick on Windows 7

when I run gem install rmagick-2.13.1.gem from the directory in which rmagick-2.13.1.gem is I get an Error saying that it failed to build gem native extension, below which it says
c:/Ruby192/bin/ruby.exe extconf.rb
checking for Ruby version >= 1.8.5 ... yes
Unable to get Imagemagick version
***extconf.rb failed***
Could not create Makefile due to some reason, probably lack
of necessary libraries and/or headers. Check the mkmf.log file
for more details.
From what I know reading the answers to FAQs on http://rmagick.rubyforge.org/install-faq.html#os, rmagick should come bundled with ImageMagick Windows Installer. The answers also mention rmagick-win32.gem. I haven't seen it anywhere. That's why I'll assume that rmagick-2.13.1.gem is what I need since it's the only one availaible, considering that FAQs refer to the older version of rmagick. So, I'm really confused about what the damned problem is.
I also took a look at mkmf.log file and the only thing that I've found there is
checking for Ruby version >= 1.8.5 ... yes
This whole thing confuses the hell out of me. So, any help would be hugely appreciated. Thanks a lot in advance.
Download zip file from:
https://github.com/rmagick/rmagick/downloads
Unzip it in a local directory
CD to that directory and type
gem install rmagick --local
Done.
If you get errors you might want to read the Readme.html file in the Zipfile
Exactly same problem.The "Read Me" in the downloaded Zip file now contains only this:
Hi, everyone -
We are no longer able to maintain
RMagick and are looking for someone or
some people to take over maintenance
of it. If you're interested or want
more details, please let us know at
admin#obtdev.com!
It is a cool project, written in C and
Ruby, with lots of great developers
relying on it. The code, originally
written by Tim Hunter, is clean and
easy-to-understand, and there are a
lot of directions you could take it to
make it even more useful.
We've had to stop maintaining it due
to ever-increasing constraints on our
time.
Thanks,
- Benjamin and Omer.
Try
gem install win32-service --platform=mswin32
gem install rmagick --platform=mswin32
First of all clear your path environment variables. (This is the main step that people often skip, but very important). This is the main reason for the error you're facing.
Then install the rails installer (2.0.0) from here : http://railsinstaller.org/en
It'll set up ruby, rails, and everything else you need. This will also set up your environment path variables for you as well.
Next install imagemagick 6.7.9.9 or lower and while installing check the option to include C headers. Make sure you install it within the rails installer folder.
Then type this in your command prompt path=c:\RailsInstaller\ImageMagick-6.7.9-Q8;%path% or whatever version you have.
Then type
gem install rmagick -- '--with-opt-dir="c:\RailsInstaller\ImageMagick-6.7.9-Q8"'
Finally edit C:\RailsInstaller\Ruby2.0.0\setup_environment.bat to include the path to ImageMagic
At line 25: SET PATH=c:\RailsInstaller\ImageMagick-6.7.9-Q8; or whatever version you have
use rmagick2 for
Ruby 1.8.2 and later, including Ruby 1.9
ImageMagick 6.3.0-7 or later
RMagick 2 is the future of RMagick. This is the version that will get new methods and support new ImageMagick features.

Resources