I've seen this error from a couple years ago when Rake would break Rails, but this seems strange.
I deployed my Rails 3.2.16 app to Heroku just yesterday, but now precompiling assets fails with no changes to any assets. Full error below:
Running: rake assets:precompile
rake aborted!
uninitialized constant Rake::DSL
/tmp/build_96e5edbe-65ff-42fc-a7e8-e59432cc8de0/Rakefile:7:in `<top (required)>'
Curious if there were recent breaking changes or what I'm missing that would all of a sudden change things.
Rake is version 10.1.0. Ruby version 1.9.3 locally and 1.9.2 on Heroku.
Saw this: https://groups.google.com/forum/#!topic/heroku/6yjIiP69NqI (from ~2 years ago), which suggested instead of just include Rake::DSL to use
class Rails::Application
include Rake::DSL
end
Still, no idea why that would change overnight.
I had the same problem just now. I updated it the ruby version to 2.0.0 in the Gemfile (it was 1.9.2) and it deployed successfully after that.
To update the version simply add this under the source line in your Gemfile:
ruby "2.0.0"
I hope this solves your issues as well.
Same issue as the rest of you, just out of the blue went to update the application and push to heroku resulting in this error. If I find anything as I play around will update here.
Huzzah, I was successful running 'git push heroku master' after reinstalling rake and updating the Rakefile for DSL support.
Reinstall Rake:
gem uninstall rake
*I selected to uninstall all versions
gem install rake
Update Bundler:
bundle update
Update Rakefile, adding the require:
require 'rake/dsl_definition'
And Update Rakefile, adding the module:
module ::ApplicationName
class Application
include Rake::DSL
end
end
*Make sure to update ApplicationName to your app name.
Committed to git and ran an update:
git push heroku master
Hope that helps get you guys back up and running, not sure what happened with Heroku but if this corrects your issue #muzcat007 maybe you could update your Heroku ticket to have them look into this odd new DSL requirement.
Cheers
Related
I am using Middleman to build a project. I receive this message any time I run a Middleman command:
Bundler is using a binstub that was created for a different gem.
This is deprecated, in future versions you may need to `bundle binstub middleman-core` to work around a system/bundle conflict.
When I run bundle binstub middleman-core, I get this:
middleman-core has no executables, but you may want one from a gem it depends on.
bundler has: bundle, bundler
rack has: rackup
tilt has: tilt
erubis has: erubis
listen has: listen
sass has: sass, sass-convert, scss
Don't really know where to go and what to do from that message.
It is not causing the anything to fail and the server runs, but I feel like this could be a bigger issue if I leave it unfixed. This ended up happening when I was playing with s3_sync to push this up to s3 bucket and I gem installed middleman-sync_s3.
I have tried research and others led me through the path of deleting the bin/* file multiple times. I've tried updating the bin also and neither helps.
Any help is appreciated.
So I was hopping around the Gemfile trying to figure out what was going on. I had built a few previous projects in middleman and decided to look them up. I saw that I was using a previous version of Middleman 3.1.0 where as with this current project I was using Middleman 4.0.0
I reverted back to 3.1.0 and ran a bundle update. Tried running a Middleman command and the binstubs message no longer appears.
Ultimately, I think it had something with the way bundler plays with middleman-core.
gem install middleman-cli seems to help in case someone else is looking for a solution to this.
I've been working on this issue for quite some time now and I did not come up with an solution so far. I have installed redmine via a bitnami stack. I set up git via gitosis as well, and now I'm trying to install the gitosis plugin for redmine. But when I try to activate the plugin with "rake redmine:plugins:migrate RAILS_ENV=production" I get the following error:
rake aborted!
No such file to load -- lockfile
Tasks: TOP => db:migrate_plugins => redmine:plugins:migrate => environment
(See full trace by running task with --trace)
I ran the command with the use_redmine script. I already installed lockfile via "gem install lockfile". bundle check returns that all dependencies are satisfied, but I still can't get this thing to work.
After reading some similar questions here, I guess it could have something to do with the passenger module.
I figured it out now. Sorry, I forgot about my post here.
The solution was kinda dumb. I did install the required packages, but I did not include them in my Gemfile.
Developing Rails and even installing Rails Applications can be a real pain in the butt -.-
I'm trying to get going on my first Ruby (v1.9.3p194) project. I'm hosting on Heroku, and using Sinatra along with ActiveRecord. I'm trying to integrate delayed_job into my project, and running into trouble getting rake to recognize jobs:work. (Yes, I know delayed_job typically works with rails, but as I understand it can work without it.)
So far, I've installed the delayed_job (3.0.3) and delayed_job_active_record (0.3.2) gems using my gemfile/bundler. Because I don't have rails, I created my own migration file from the delayed_job readme, and migrated it. I don't think any of this should be causing my issue.
From all the docs I've seen, installing the gems should do the trick. I've tried uninstalling and reinstalling them, to no avail. I'm not sure what else to try - perhaps there's something I need to explicitly include in my rakefile, but I haven't seen any docs that indicate that.
Any help greatly appreciated.
Maybe I have an actual answer for you.
I made a simple project to get jobs:work to show up with rake -T:
Gemfile
source :rubygems
gem 'delayed_job'
Rakefile
require 'rake'
require 'bundler'
require Bundler.load.gems.find{|i| i.name == 'delayed_job'}.gem_dir + "/lib/delayed/tasks"
run: $ bundle install
Result:
$ rake -T
rake jobs:clear # Clear the delayed_job queue.
rake jobs:work # Start a delayed_job worker.
I've wanted to have a look at Sinatra after a long hiatus so I looked for a boilerplate to get it up on running on heroku quickly and found this > https://github.com/froots/sinatra-heroku-boilerplate
It seems to have everything I would need so I did bundle install, but whenever I fire up shotgun I'm running into this error:
Something went wrong while loading config.ru
NameError: uninitialized constant Object::DataMapper
In the Gemfile, line 5 - it should be gem 'data_mapper', not gem "datamapper", ">=1.1.0"
Once you've updated the gemfile, do another bundle install
Update:
I've submitted a pull request for the author to fix his code: https://github.com/froots/sinatra-heroku-boilerplate/pull/2
I'm using has_secure_password in a new application and it works great locally. However, when I deploy to our server and try to run it I get the following error message:
undefined local variable or method `has_secure_password' for
WorkerLogin:Class
I did a bundle install and everything so I'm not sure what's missing. I'm on ruby 1.9.2p290 but I don't think that would be the problem.
Thoughts?
I eventually realized I didn't have my latest code pushed to GitHub yet when I did the Capistrano deployment. I had include ActiveModel::SecurePassword added to my WorkerLogin class but not checked in. This line is required because I'm using MongoDB/MongoMapper and it doesn't automatically include ActiveModel::SecurePassword like ActiveRecord does.
In Gemfile uncomment or add this line:
gem 'bcrypt-ruby', '~> 3.0.0'
and run bundle install