how to get paperclip installed in rails 3 as gem - paperclip

hello i am new to ruby on rails please help me and guide me through the problem i am getting...
i want to upload profile image for ech user using paperclip
BuT I DONT KNOW HOW TO INSTALL IT
i want to install it as gem
i am doing the following thing:
gem install paperclip
bundle install
.... at the console
but on doing
rails generate paperclip user image
i am getting error could not find generator paperclip
please guide me through correct steps to upload image using paperclip as gem

Step#1
ImageMagick must be installed in the system and Paperclip must have
access to it. ImageMagick is a software suite to create, edit,
compose, or convert bitmap images. It can read and write images in a
variety of formats.
Step#2
Include the paperclip gem in your Gemfile
gem "paperclip"
Then run the bundler to install the gem
bundle install
as You are new to Rails:
It will be good if you go through this Tutorial and usage
documentation under the repo of paperclip.

Related

Error: You cannot use gems with Shopify CLI

I am new to Shopify theme development. Currently following the tutorial by Shopify. Everything was going smoothly but I am getting the following error every time I run "Shopify theme serve":
[Note] You cannot use gems with Shopify CLI.
[LoadError] cannot load such file -- wdm
They are disabled.
Please don't modify the CLI locally.
If you would like to contribute to the CLI project, please refer to
https://github.com/Shopify/shopify-cli/blob/main/.github/CONTRIBUTING.md
Please add the following to your Gemfile to avoid polling for changes:
gem 'wdm', '>= 0.1.0' if Gem.win_platform?
X You are not authorized to edit themes on banana-man-co.myshopify.com.
Make sure you are a user of that store, and allowed to edit themes.
Also, I know it says I am not authorized to edit themes but I am pretty sure that I am logged in as the admin. Anybody know how to fix this?
Run
gem install wdm
on the command prompt.
Then you won't see this issue but still see
X You are not authorized to edit themes on banana-man-co.myshopify.com.
Make sure you are a user of that store, and allowed to edit themes.
Follow Caution section on https://shopify.dev/themes/tools/cli/getting-started.
For arch linux where shopify-cli is installed using:
gem install shopify-cli
You need to install the Bundler:
gem install bundler
See more details in archlinux ruby wiki. Hope this helps someone.

Way to add gem file to Dashing framework

I need to use Rally API dev kit rally_rest_api gem. I'm new with ruby. Is the any way to do it quickly ?
Thanks for helping !
You should have a file called Gemfile in the root of your Dashing project. It should already contain the dashing gem itself:
gem 'dashing'
Simply add the following below it:
gem 'rally_rest_api'
And run bundle install. To actually use the gem in your project, take a look at the documentation.

Using standard initial jekyll set up, jekyll serve watch resulting in LoadError

I've used the tutorial for Jekyll to set up a very basic blog and have hosted it on the localhost using jekyll serve, but when I use jekyll serve --w, the site generates then command gives
C:/Ruby193/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:in 'require':
cannot load such file --wdm (LoadError)
Followed by a lot of other information
I'm running Ruby 1.9.3 on Windows.
If it can't load wdm, I'd try:
gem install wdm
edit: Looks like you're not alone. First Google hit.
You need install wdm and directory_watcher:
gem install directory_watcher
gem install wdm
And remember add this line to Gemfile:
gem 'directory_watcher'
gem 'wdm'
Good luck!

What is a Ruby gem?

I've searched on Google, and I just found the uses of gem. As in, gem install, etc.
Are gems collections of .rb scripts?
If I build a series of scripts, for example that wraps the functionality of Google translate, is the preferred way of distributing that for usage a gem?
If not, how would I distribute this code?
According to RubyGems Wiki - RubyGems is a package manager for the Ruby programming language that provides a standard format for distributing Ruby programs and libraries (in a self-contained format called a "gem"), a tool designed to easily manage the installation of gems, and a server for distributing them.
The gem command is used to build, upload, download, and install Gem packages.
Gem Usage
RubyGems is very similar to apt-get, portage, and yum in functionality.
Installation:
gem install mygem
Uninstallation:
gem uninstall mygem
Listing installed gems:
gem list --local
Gem Package Building
The gem command may also be used to build and maintain .gemspec and .gem files.
Build .gem from a .gemspec file:
gem build mygem.gemspec
For more info, refer to RubyGems Manuals.
Here are some nice tutorials :)
http://railscasts.com/episodes/135-making-a-gem
http://railscasts.com/episodes/245-new-gem-with-bundler
A gem is a module/Library that you can install and use in every project on your server.
A plugin is a module/Library that you can use inside your project
Indeed, if you make some code what you like to share you can make a gem or plugin of it. You can publish it on for example github.com. You can check the source of the existing gems on github if you like to know how to make a gem as well.
Gem Package Building
Step : gem build your_gem_name.gemspec
simple steps follow click here

Manually adding a Ruby Gem

I am trying to install the mechanize gem that is supposed to work with 1.9 from here: http://github.com/kemiller/mechanize but I do not know how to add it manually.
I am using Windows, I could just copy the folder to the gems directory, but how do I initialize it?
I'm not sure I understand the problem. gem install mechanize doesn't work? It produces version 0.9.3 for me, which matches the gemspec of the library you linked to.
EDIT: you're on 1.9. I knew that. Disregard my hasty post, not familiar enough with Windows to offer any help on building the extensions.
I would use the bundler gem using the command gem install bundler. This will create a file called Gemfile in your project directory where you can put your dependencies for the specific project that you are working on. In the Gemfile, you will need to specify gem mechanize. If you want a specific version include ~> VERSION after. After, run the command bundle install. This will install the gem you want and use it in your project.

Resources