Rails app config.eager_load set to nil? - ruby-on-rails-3

During cap <env> deploy I get the following error, but all my environment files are set accordingly. What is the deal?
config.eager_load is set to nil. Please update your config/environments/*.rb files accordingly:
development - set it to false
test - set it to false (unless you use a tool that preloads your test environment)
production - set it to true
UPDATE:
I believe this is because capistrano is not pulling down the latest changes from the branch. Does capistrano cache the branch somewhere? I believe this is the case because the latest release which was 10 minutes ago doesn't include my most recent changes.

So this was happening because the repo directory is kind of like a cache...I guess. I just removed it via rm -rf repo and then re-deployed.

Related

MacOS - bundle not executing due to permissions?

So I've made MACOS_BUNDLE in cmake, & macdeployqt. Everything went great but there is 1 problem. If I run the app on mac where I developed it = all good. If I run it on another MAC, then nothing runs. I have to manually set sudo xmod +x "testApp.app/Contents/MacOS/testApp" So my question is... do I need to ship a mini .sh file that would set the permissions on other pcs too or can I somehow... configure bundle to have it already set?
Thanks

Bundler::GemNotFound when compiling assets from cap deploy

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.

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.

rvm install fails with or without rvmrc

I'm using rvmrc with the following text:
rvm_path=/local/rvm
(on Ubuntu 11.10) but trying to install gives an obscure error:
$ bash < <(curl -s https://rvm.beginrescueend.com/install/rvm)
Successfully checked out branch ''
Current branch master is up to date.
Successfully pulled (rebased) from origin
: No such file or directory
Any ideas?
You have no need at all to set $rvm_path. You're using a multi-user install. Please follow the explicit instructions for the Multi-User install at https://rvm.io and remove any existing installations, remove /etc/rvmrc, /etc/profile.d/rvm.sh, and $HOME/.rvmrc. Comment out any RVM sourcing lines in your .bash_profile, and .bashrc and log out of the machine then back in. Then reinstall correctly. Setting the rvm_path has never been a requirement of the installer UNLESS you already have a Multi-User working installation in place, and you want to attempt to use a per-user install with it. THEN you would preset the $rvm_path to $HOME/.rvm in your own $HOME/.rvmrc, log out then back in and then attempt the install again. BUT, that is not a supported installation type. Which is why 99.999% of users will not need to set rvm_path at all.
The real problem was that the git configuration for auto-converting line endings was not set correctly which prevented any installation from working. It had nothing to do with using rvmrc settings.
The fix for this is simple (and comes straight from the github help page):
$ git config --global core.autocrlf input
Line endings are important in linux and by forgetting that setting, everything the rvm-install script was pulling from github had \r\n endings. I made that change so long ago on my work machine, I didn't even remember it -- but it was not set on my home system.
I'll leave it up in case someone else has the same problem.

Atlassian Bamboo: First plan with a simple job of downloading a local git repo

I just downloaded the free trial of Bamboo continuous integration server, and created the first plan with nothing but downloading the source code from the git. I have a local git repository on the bamboo machine so the git URL is pointing to a local path.
The problem is that when I run the job, it never finishes even after waiting for an hour. This is the last lines of the activity log:
07-Apr-2011 20:03:23 Checking out revision f9dc82500914333ed4bbdae5ed038771fd658c3c.
07-Apr-2011 20:03:23 Creating local git repository in '/home/bob/bamboo-home/xml-data/build-dir/DEV-DEV-1/.git'.
From the shell I can go to the directory shown in the log and see that the source code were cloned correctly to the bamboo working directory. But the job will never finish and the log will not have any more update from here. I have to manually terminate the job. Any ideas? Do I miss something?
Just a guess, since the Bamboo instance we have at work pulls from Accurev and not Git, and I've never run into this problem myself - but it may be hung because there isn't a builder defined for that plan. You might try defining a builder (even if it's one that you know will fail) just to see if it makes it to that next step.
I had very similar problem.
It's not very original solution but I just uninstalled bamboo and installed it again.. Now it works now