Bundler::GemNotFound when compiling assets from cap deploy - ruby-on-rails-3

I'm deploying to servers with capistrano and doing a bundle exec rake RAILS_ENV=production RAILS_GROUPS=assets assets:precompile as the last step. Problem is when it gets to this point FROM cap deploy, i get the following error:
/usr/local/rvm/gems/ruby-1.9.3-p194/gems/bundler-1.1.4/lib/bundler/spec_set.rb:90:in `block in materialize': Could not find Platform-0.4.0 in any of the sources (Bundler::GemNotFound)
Platform-0.4.0 IS in fact on the server. And when i go into the server and run this exact command, all works great.
Couple of facts about my server: its using RVM, but that doesn't seem to be an issue with cap as the stack trace above would suggest. The other fact of interest is that this server was first created with a custom script I wrote that downloads an archived version of the git repo and then manually runs what cap does on a deploy. The reason I'm doing this, if anyone asks, is for automation with AWS AutoScaling. If i do a normal deploy:setup (not using my AWS script), it works fine with deployments. But the gem list is the same, and the site works all the same either way. Its just something with the cap deploy
Any thoughts?

I figured out what I was doing wrong. on my custom AMI scripts, i was naming the initial release folder 'first' when it should be a timestamp the way capistrano normally names it. That screwed things up on subsequent deployments.

Related

Deploying Custom Cartridges on Openshift Origin

I have created a new custom cartridge, in which I have packaged into an rpm using tito and installed using yum. This cartridge is being copied from my spec file to the /usr/libexec/openshift/cartridges directory, however, when I log into the origin home site and try to create an application my cartridge does not show up. I went digging in the ruby scripts and I found that there is a script named cartridge_cache.rb seems to be caching the cartridges it finds within the /usr/libexec/openshift/cartridges directory. I have tried to get origin to reload the cache to include my new cartridge by removing all the cache files within the /var/www/openshift/broker/cache directory then restarting the broker, but I have had no success. Is there somewhere I need to hardcode my cart name to some global variable or something ? Basically, Does anyone know how to get your custom cart to show up on the webpage for creating a new application.
UPDATE: So I ran into a slide deck that had one slide on how to install the cartridge. However, I still have had no success, but here is what I have tried since the previous post:
moved my cartridge directory from /usr/libexec/openshift/cartridges to /usr/libexec/openshift/catridges/v2
ran this command
oo-admin-cartridge -a install -s /usr/libexec/openshift/cartridges/v2/myfirstcart
which the output stated it installed the cartridge.
cleared cache with
bundle exec rake tmp:clear
restarted the openshift broker service
Also, just to make sure the cache was cleared out I went into the Rails console and ran Rails.cache.clear. And still no custom cartridge on the openshift webpage.
It works for me after cleaning cache
cd /var/www/openshift/broker
bundle exec rake tmp:clear
and restarting broker service
service openshift-broker restart
http://openshift.github.io/documentation/oo_administration_guide.html#clear-the-broker-application-cache
MCollective service on Node server (if you have separate servers for broker and node) must be restarted. e.g. with
service ruby193-mcollective restart
After that you should clear the caches on broker server e.g with
/usr/sbin/oo-admin-broker-cache --console
Then you should have new cartridges available

How can I run oink in heroku?

I'm having a problem running the oink gem on my app in Heroku. I've included it in my gemfile and gemfile.lock, uploaded those, and it installs. It even creates the oink.log (which I have no way of viewing, unfortunately). When I run
heroku run bundle exec oink --threshold=0 log/* --app my_app
I get
Running bundle exec oink --threshold=0
log/delayed_job.log log/development.log log/oink.log log/production.log log/test.log attached to terminal... up, run.3
/app/.bundle/gems/ruby/1.8/gems/oink-0.9.3/bin/../lib/oink/cli.rb:88:in get_file_listing':
Could not find "log/delayed_job.log" (RuntimeError)
from /app/.bundle/gems/ruby/1.8/gems/oink-0.9.3/bin/../lib/oink/cli.rb:86:ineach'
from /app/.bundle/gems/ruby/1.8/gems/oink-0.9.3/bin/../lib/oink/cli.rb:86:in get_file_listing'
from /app/.bundle/gems/ruby/1.8/gems/oink-0.9.3/bin/../lib/oink/cli.rb:59:inprocess'
from /app/.bundle/gems/ruby/1.8/gems/oink-0.9.3/bin/oink:4
from /app/.bundle/gems/ruby/1.8/bin/oink:19:in 'load'
from /app/.bundle/gems/ruby/1.8/bin/oink:19
I've tried running each of the individual files, too, and get the same result. This command runs fine on my local machine.
In my production.rb file, I have
config.logger = Hodel3000CompliantLogger.new(config.paths.log.first)
config.middleware.use( Oink::Middleware )
as configuration.
Can you enlighten me on what I'm doing wrong here? My understanding is that the logs are read only, but I don't know if that means they're only accessible through the heroku logs command. If there's a way I can see the oink.log file, too--knowing how to do that is also appreciated, or knowing how to see it in the actual Heroku log using heroku logs.
UPDATE: The configuration for oink shown above allows the commands to be run successfully on my localhost.
Thanks!
-Andrew

Queue_Classic: How to run the rake task automatically on Heroku without Procfile

i need to know how to run the queue_classic (rake qc:work) rake task automatically on Heroku. I tried with Procfile, but i am using Bamboo and i get the next error: "Heroku push rejected, Procfile is not supported on the Bamboo stack"
any idea??
Thanks.
On heroku there is a addon viz heroku-scheduler, its free. Add this addon to your application. It will appear in your application addon lists, click it, and you will lead to worker dashboard where you can add job for example
bundle exec rake task_name
and schedule the task.

How to display RoR app code version on heroku?

For my Rails apps I normally deploy to production from a tagged version, and then display the tag in the user interface assigning the output of git describe --always to a variable in config/application.rb.
Now I'm moving an app over to Heroku, and deployment to heroku only happens using the master branch, so this trick won't work any more.
Are there any other ways to assign a version number to my code and display it on the UI when I've deployed to heroku?
Thanks,
Stewart
You can add a variable to the Heroku configuration by running this command locally whenever you push new changes to Heroku:
heroku config:add GIT_TAG=`git describe --always`
Then you can access this in your app's configuration:
version = ENV['GIT_TAG'] || `git describe --always`
When the app is running on Heroku, it will pick up the config variable (ENV['GIT_TAG']) and when it's running locally in development it will fall back to running git describe --always.
You will need to update the Heroku config variable each time you deploy, but I generally add this kind of thing to a deploy script or rake task (along with useful things like creating a new tag marking the deploy and running any new database migrations on Heroku).
Doesn't git tag fit your needs?
And why wouldn't the old trick work anymore?
If you want to display it on the UI then a git SHA output probably isn't particularly useful - you have two options, set a Heroku config variable with a user friendly version number in or a set a version number in your code that you increment when you deploy from master. You could probably wrap the deploy up in a rake task that incremented the version number either a file (and then readded it to git and commits it) or simply increments a value in a config variable.
Also, don't forget Heroku release management http://blog.heroku.com/archives/2010/11/17/releases/ which you may also be able to employ here to get the version number from that perhaps.

Rhomobile rake redis aborted

I am working my way through the RhoMobile tutorial http://docs.rhomobile.com/rhoconnect/command-line#generate-an-application and I at the point of entering
rake redis:install
I get the following error.
WARNING: using the built-in Timeout class which is known to have issues when use
d for opening connections. Install the SystemTimer gem if you want to make sure
the Redis client will not hang.
See http://redis.io/ for information about redis.
Installing redis to C:\RhoStudio\redis-2.4.0;C:\dropbox\code\InstantRhodes\redis
-1.2.6-windows.
rake aborted!
Zip end of central directory signature not found
Tasks: TOP => redis:install => redis:download
(See full trace by running task with --trace)
D:\Dropbox\code\rhodes-apps\storeserver>
I am working on a Whindows machine, primarily using RhoStudio.
It ended up being an environmental variables issue. Also, it seems the main support forum for Rhodes is the Google Group. Question answered here:
https://groups.google.com/d/topic/rhomobile/b-Adx2FDMT8/discussion
If you are using Rhostudio in windows then redis is automatically installed with Rhostudio.
So no need of installing it again.