based on the needs of my app, I need to make a modification to paperclip, it's only one line but it makes all the difference for my apps needs.
In my Rails 3 GEM FILE I have the following:
gem 'paperclip', '2.3.5'
With github, how does one go about making there own paperclip GEM? So I can use it on Heroku?
Something like
gem 'paperclip', '2.3.5' -> my version?
Would love to hear how this is done. How this is maintained as paperclip is updated. and how I use this locally and on Heroku.
Thanks
Here's the github page on 'Forking'. http://help.github.com/forking/
You must fork the repo on github. Then, instead of passing a version in the Gemfile, pass the following:
gem 'paperclip', :git=>'git://github.com/username/repo.git'
Why are you creating a gem for this? You can monkey patch the gem. This will allow you to use the standard version. What is the change you need? What is the link to your gem, may be there is an easier solution.
Related
I'm going to create a new Rails project, and as I know I should use gem 'bootstrap-sass', it's not a problem for me. But I have one question - why I should use gem instead of just adding some files (CSS and JS) directly to index.html? Can you explain me? Thanks in advance!
Use gem or source files don't make any big difference.
But, when you use gem it's easier to update... you need just update the gem and it's done! And when you use the source files, you must download the new version and replace the old files. I think it's the big deal when using gem: easer to update.
I want to use ember.js in an application. Found that there are 3 gems for that:
emberjs-rails
rasputin
ember-rails
Not clear which one to go with. Please help me decide.
I would recommend going with ember-rails, the officially maintained gem. Paul Chavard, the author of rasputin, has recently brought a lot of the good ideas from rasputin into ember-rails.
Ember-rails pre-compiles handlebars templates and work with multiple extensions (".js.hjs", ".hbs" or ".handlebars"). It's also flexible in how templates are referenced from within your ember views (see the options in the README).
Unfortunately, I think there's been a temporary issue pushing updates to the gem to rubygems.org. For now, if you want to work with the latest rev, you'll need to include the gem straight from git:
gem 'ember-rails', :git => 'git://github.com/emberjs/ember-rails.git'
When I create a gem generator, it seems does not work at all. Is there any tutorial you would recommend?
My colleague did something similar.
Take a look through that gem and it should be easy enough to replicate.
Instead of directory you might need template:
template('app/assets/stylesheets/gemstyles.css', 'app/assets/stylesheets/gemstyles.css')
I'm working on a small gem that will extend the paperclips has_attached_file method. I need this gem to be loaded after paperclip.
Is there a way to know the order in which the gems are loaded? And is there a way to modify that order?
Thanks a lot,
NHI
In your gemspec require the other gem then it should load before yours.
See the docs for more information.
i guess this might help give it a try.
gem 'New-Gem','some-version', :require => 'paperclip'
I had to add a Railtie to make this work. Paperclip was loading before my gem but wasn't include until much later...
I just installed a ruby gem
gem install anemone
But I cannot hit off to use it directly in my rails application, this is the first time I'm using an external ruby library so it will be very helpful if you can give me an insight into it rather than just a solution
Cheers
In your Gemfile add:
gem 'anemone'
This way Rails will load the library when it starts, and you can then use it. You don't even have to use the require keyword.
You must put used libraries into Gemfile. Everything about gemfiles is available on Bundler page.
There's an official Rails guide about this topic.
You also need to use 'require' and the name of the library on top of the file where you want to use the library. For example if you are using nokogiri you would need to add the line require 'nokogiri'