Is it possible to override gemfile for local development?
Set BUNDLE_GEMFILE
environment variable:
BUNDLE_GEMFILE=Gemfile.local bundle exec rails c
To provide a “delta” only in the Gemfile.local
put require_relative 'Gemfile'
on top of it (or Bundler::Dsl#eval_gemfile
as suggested by @MichaelKohl in comments.)
Using local assets to override gem file assets
By default, Rails should be using your local image_x.jpg.
To check the order that Rails will search for assets, open your console and type:
Rails.application.config.assets.paths
You should be able to verify that your app/assets directory appears before the gem's assets directory in the search PATH. If not, something may be modifying your asset path.
If your asset path looks wrong, you can easily modify it. (It's just an Array of Strings.) To add a new highest-priority directory, try adding something like this to an initializer:
Rails.application.config.assets.paths.unshift "/some/other/path"
Also try deleting tmp/cache/assets
and restarting your server.
How can I use the gemspec rule in Bundler, while still using a local checkout of a gem?
A few people have found this problem, Yehuda Katz has said he would happily accept a patch: http://groups.google.com/group/ruby-bundler/browse_thread/thread/d4215c4930a63ffc?pli=1
As the best workaround, comment out the gemspec line in your gemfile and suffer some duplication?
Update:
It looks like you don't have to wait - https://github.com/carlhuda/bundler/commit/03378109d
The commit message:
"Make it possible to override a .gemspec dependency's source in the Gemfile"
hooray!
How can I specify a local gem in my Gemfile?
I believe you can do this:
gem "foo", path: "/path/to/foo"
Related Topics
Rails How to Change Attribute Name When Rendering JSON
Ruby: Differencebetween the Comparatives: "||" and "Or"
How to Implement Yes/No Instead of Boolean for Certain Cases in Rails
Change String in a Date Format to Another Format
Sort a List of Objects by Using Their Attributes in Ruby
Could Not Find Rake with Bundle Exec
Save Image with Mechanize and Nokogiri
Activerecords Select(:Id).Collect VS. Pluck(:Id) Methods: Why Is Pure Ar "Pluck" Slower
How to I Add a Hyperlink to a Cell in Axlsx
Need to Use Add_Index on Migration for Belongs_To/Has_Many Relationship? (Rails 3.2, Active Record)
Kill Process and Sub-Processes in Ruby on Windows
Convert Timestamp Timezone in Logstash for Output Index Name
Rails 3.2.8 - How to Get the Week Number from Rails
Rails: How to to Download a File from a Http and Save It into Database