I have installed gem 'webpacker' and then, commited to the server. However, when I deleted the gem, the new setting haven't been updated on Heroku.
When I run the app:
/app/vendor/bundle/ruby/2.5.0/gems/railties-5.1.6/lib/rails/railtie/configuration.rb:95:in method_missing': undefined methodwebpacker' for # (NoMethodError)
Someone knows how to re-do gem process in the server? Thank you!
More than likely you still have some config items leftover. Search your application for webpack and webpacker. You may find a webpack folder in your config, at least.
https://github.com/rails/webpacker
I would recommend going through the setup again, to make sure you removed everything.
From the error it seems that your Gemfile.lock is not being updated.
First delete the Gemfile.lock on local system
Then remove the gem from Gemfile on local system.
Then bundle on local system with the gem in Gemfile removed.
Commit and Push to Heroku.
Hope it helps!!
Related
I have been having a problem with assert_template in rails. When running rails t it gives me an error message:
NoMethodError: assert_template has been extracted to a gem. To continue using it, add gem 'rails-controller-testing' to your Gemfile.
After adding gem 'rails-controller-testing' to the Gemfile and running bundle install everything worked great.
However, when using a different computer and using git pull to sync the repository it doesn't work. Instead it just shows the same error as above.
Always remember there's two Gemfile files. There's Gemfile, which you edit, and then there's Gemfile.lock. You add something to the Gemfile manually, you then run bundle install, which will lock the version. You edit the Gemfile directly, but the Gemfile.lock is a system managed file that you don't touch. Make sure you commit and push them both after adding a Gem :D
This is my first question on StackOverflow. Please bear with me if I am doing it wrong.
I am working on a ruby on rails application and had to change the source code of a gem I am using in
/Users/username/.rvm/gems/ruby-2.0.0-p353/gems/gemname-4.1.0.
This works well and I make a fork of the gem on github, applied the changes I made, pushed, and change my gemfile line from
gem 'gemname'
to
gem 'gemname',:git=>"git#github.com:/name/gemname.git"
I run bundle install again and now the changes made are not applied to my application anymore.
When I do bundle show 'gemname' I saw the gem is install in
/Users/username/.rvm/gems/ruby-2.0.0-p353/bundler/gems/gemname-a0ed76fc98e2
I am not an expert on how bundle and github works. If anymore could explain how they work and what I should do to use my own forked version of the gem in my application, it would be very help!
Thanks in advance!
you could also write:
gem 'gemname', 'git://github.com/name/gem_name.git
or:
gem 'gemname', github: 'name/gem_name'
also be sure that you have your changes in master, and restarted your server after bundle
I ended up doing,
gem 'gemname',:git => "git#github.com:/myname/gemname.git", :branch => '1.1'
and it works fine now.
I think the problem is that I need to specify the branch 1.1 which is my branch, otherwise it uses the master's branch which my changes are not applied.
I have a Gem on my local machine that I declare in my Gem file like this:
group :assets do
gem 'my_gem', path: "/Users/me/path/to/my_gem"
end
This works great locally, but when I push to staging on Heroku, the build fails because the gem isn't available.
Currently I'm having to comment/uncomment this gem between deploys which is a real pain.
I've also tried adding it to my development group, but this doesn't help.
Why is Heroku looking for this gem?
Bundler always needs to resolve all of the gems in your Gemfile. You shouldn't commit a Gemfile that contains a local path.
Instead, push your gem to a git repository that is reachable from Heroku and point to that in your Gemfile.
For development, you can use a local path override: http://bundler.io/v1.3/git.html#local
you can try placing the gem in vendor/gems directory, create it if it doesn't exist.then in your Gemfile do like this:
gem 'rails_multisite', path: 'vendor/gems/rails_multisite'
and make sure you run bundle update so Heroku can Pickup the changes
I have installed ajax_pagination gem from https://github.com/ronalchn/ajax_pagination
When I restart my server i get this message
couldn't find file 'history'
(in
/Users/user/.rvm/gems/ruby-1.9.3-p362/gems/ajax_pagination-0.6.3/lib/assets/javascripts/ajax_pagination.js.erb:3)
and inserted calls in assets manifests, rails version is 3.2.8
I had tried installing a history gem ( https://github.com/philostler/historyjs-rails ) or adding history.js to assets but nothing helps
Thanks for any help!
I had the same issue, all you need to do is:
Add gem 'jquery-historyjs' to your Gemfile,
Run bundle install
Then rails generate historyjs:install
This appears to be a bug in the jquery-historyjs gem, which ajax_pagination depends on. You may want to report an issue on their github repo.
As a work-around, you could create a blank history.js file in app/assets/javascripts and try bringing in historyjs-rails.
I've forked a gem, and in trying to change it, decided to change the the gemfile from my git repository (which had been updating fine):
gem 'bootstrap-wysihtml5-rails', :git => 'git://github.com/Asherlc/bootstrap-wysihtml5-rails.git'
to the local directory (just the cloned git repository):
gem 'bootstrap-wysihtml5-rails', :path => '/Users/ashercohen/Documents/bootstrap-wysihtml5-rails'
Upon running either bundle update or bundle install, it shows the correct version number (updated since switching gem sources) in the readout. However, none of the files in the /vendor/assetspath seem to be getting updated in my Rails app. Is there some kind of caching thing I need to clear out?
I don't have a /vendor/cache file in my Rails app, and I'm confident that since the gem version is updating correctly in the bundler readout that the path is correct.
Is there some step I'm missing here?
Turns out Chrome was just aggressively caching the JS.