I have a requirement in my Rails application (3.0.7) for the gem yajl-ruby. For some weird reason, every time I do a push, Heroku (Bamboo stack) doesn't recognize that the gem is listed in my gemfile.
So what happens is that my application crashes each time I do not push the gemfile. To fix this, I need to change something in my gemfile (like add a character to a comment or something inconsequential like that) and push the gemfile to Heroku again (even though there were no gem changes). It doesn't make sense because when I close from my Heroku git (even when the app is in a crashed state), the gemfile is fine, with yajl-ruby in there.
Has anyone else ever had a similar issue? I'm trying to figure out why this is and how it can be rectified so I don't need to keep making these small changes to my gemfile and pushing it?
Related
First time I've seen this error when running a migration on Heroku.
heroku rake db:migrate --app myapp
(in /app)
New Relic Agent not running.
I have the New Relic addon in my app addons so would this be an issue with the heroku platform or my app?
edit: App is running on the bamboo-ree-1.8.7 stack.
The answer is that Heroku is telling you that the New Relic Agent is not running in that environment when you run rake, however rake db:migrate is still working, so actually everything is working as it should.
Simply run your rake db:migrate, ignore the New Relic message, then heroku restart and everything should be working just fine.
Seems this was a simple fix. The new relic addon on Heroku stopped working and simply required me to remove and add it back to my application.
I'm using Rails v. 3.0.9 and have pushed the app to Heroku. When I view the custom Heroku domain I get the following message from Heroku:
"We're sorry, but something went wrong.
We've been notified about this issue and we'll take a look at it shortly."
I run heroku logs and don't seem to get any error messages. The only error I encounter with Heroku seems to be when I run heroku rake db:migrate with which I get the following in return:
rake aborted!
uninitialized constant Rake::DSL
Note: I'm new to Rails and to Heroku. I'm not quite understanding the difference between production and development environments. Do I need to be in production for Heroku to work? At the moment, I'm using localhost3000 to view my app. Thanks guys!
I have a blog post about it here:
http://codeglot.com/posts/13-you_have_already_activated_rake_0_9_2
There are two solutions. Use an older version of rake or require DSL.
quick question about Heroku. My app is using a gem called opentok. To function outside of a "sandbox" mode, the app requires changing an API link in a gem file called opentok.rb. I did that locally and the app works fine. however, when I deploy to heroku, the app does not work because heroku looks at my gem file and gets the unmodified gem lib of opentok which then runs my app on the heroku server in sandbox mode.
Is there a way I can access the opentok gem file (opentok.rb) on the heroku server and edit it with gvim from a console?
Thank you!!
Unpack the gem to your vendor directory, edit it as you require, then tell Bundler where to retrieve the gem from.
Command line:
gem unpack opentok-VERSION --target vendor/gems
Bundler:
gem 'opentok', :path => "vendor/gems/opentok-VERSION"
After you've done all this, do a bundle install, add the vendored Gem to your git repository, and push to heroku.
For the opentok gem, though, the api url can be passed directly as an option:
opentok = OpenTok::OpenTokSDK.new #api_key, #api_secret, :api_url => 'https://api.opentok.com/hl'
this feature is documented in the spec/opentok_spec.rb file. Look for:
it "should be possible to set the api url as an option" do
Thanks to Stijnster, the opentok gem creator, for pointing it out to me!
I've been working on a on uploading my RoR3 website onto Heroku.
Took me a while to get it up. Seems to work pretty good but when i try creating a project (my website manges donation projects) i get the next message:
We're sorry, but something went wrong. We've been notified about this issue and we'll take a look at it shortly.
No idea what causes this it works fine on my localhost.
The normal Rails Error - Have a look at the Heroku Logs and check the Stack for more details then post them back on here.
Usually when I've had this problem, it's because I've forgotten to run db migrations at Heroku.
In terminal, in your rails app folder, run this:
heroku rake db:migrate
If needed, you can find more info in this thread.
I'm working with Alex Reisner's geocoder gem on a Rails 3 app (3.0.3) because I'm concerned about GeoKit's shakey Rails 3 compatibility. Alex's gem looked perfect for my application so I started using it and had it working flawlessly last night on my Macbook. I pushed the app to Github when I got it running.
Today, I did a git clone of the app on a desktop Mac. Same version of Ruby, Rails and identical source and Gemfile. This time geocoder is throwing this exception:
NameError (uninitialized constant Geocoder::Net):
app/controllers/restaurants_controller.rb:16:in `create'
My models use after_validation :fetch_coordinates to geocode the model upon save.
Has anyone noticed any other dependencies outside the bundle that could cause this? I like the way Alex put this one together but may give geokit-rails3 a try even though it's an unfinished port.
I just released gem version 0.9.7 which should solve this problem.