Newrelic rpm does not work with Rails 5 + Rocketpant - ruby-on-rails-5

I recently upgrade my Rails app from 4.2.5 to 5.0.2
Everything works fine except Newrelic RPM to track our API performance.
On Rails 4.2.5, we are using a folk of the gem 'rocket_pants-rpm' to make Newrelic track Rocketpants API endpoint correctly.
https://github.com/Sutto/rocket_pants-rpm/pull/3/files
But after upgrading to 5.0.2, this fork does not work anymore.
I am not very familiar with how the Newrelic agent works, any idea to make Newrelic work with Rails 5 + Rocketpants again?

I fix the issue myself. It turns out the gem rocket_pants-rpm doesn't load Newrelic agent since it does NOT check Rails major version 5.
I have submitted a pull request
https://github.com/Sutto/rocket_pants-rpm/pull/4
Which solves this issue, now Newrelic shows my API endpoints under namespace Api::V1 again : )

Related

Why are development style sheets and devise logout not working?

I have a 3.2.8 Rails application which has been deployed into production and is running just fine. While preparing to code an enhancement I pulled fresh code from the SVN and started up a development version of the application and found the stylesheets were non functional and the Devise logout did not work in DEVELOPMENT.
All other aspects of the application work exactly as they should.
I've been reading many stack over flow Q & A and cannot figure this out.
Then I realized the default version of Ruby did not match the version for the application.
The application was built with ruby 1.9.3 p286 and my machine boots up in Ruby 2.1.0
solution:
stop the server
rvm use ruby-1.9.3-p286
bundle install
rails server
= good to go.

Sidekiq "needs X11" in a rails project

I'm trying to use sidekiq in a project but have run into an unusual problem that makes no sense.
I've got multiple rails applications on my laptop, many of which are using sidekiq, and are running fine without any problems.
This application also uses sidekiq, and used to work however I'm not running into a problem. I've not touched the project for a while, but the only difference between now, and when it used to work is the upgrade from OS X Lion, to Mountain Lion. This however hasn't effected other projects, so I'm not sure what's going on. When I try to launch Sidekiq, I get an alert stating
To open "sidekiq," you need to install X11.
Would you like to install X11 now?
It's the standard Apple alert, however I don't understand why Sidekiq is supposedly trying to use X11, and why it isn't using it on my other projects?
I'm using
Rails 3.2.8
Ruby 1.9.3p125
Sidekiq 2.13.1
Any help would be really appreciated :)
Got it running. Turned out it wasn't an issue with Sidekiq, but rather ruby for some reason. After I updated ruby to 2.0.0 and fixed other gem issues, the app started up again and is now running. No idea what was going on but it's sorted :)

Pushing new Rails 3.1 app to Heroku causing problems with Sorcery mod (requiring bson-1.4.1)

I have an app that runs great locally. Everything seems to be set up correctly to transfer over to Heroku, including the Postgres gem (and dev was done using a postgres server).
The problem is, when I try to push it up, I get error messages surrounding the three currently problematic dependencies, bson_ext, bson, and mongoid, 1.4.1. It seems that Sorcery requires these (at 1.4.1) to run. I got them installed locally by downloading the manually, but they were yanked from the online sources. So when Heroku tries to find them, it can't, and it aborts. I tried specifying to use 1.4.0 for all of them, and the app then installs fine (and does the database setup stuff for the Cedar stack, etc).
The problem is that when I load the app on their server, I get the generic "oops, there's been a problem" Heroku message. Upon checking the actual heroku log, I can't really find anything wrong. What is the way to make this work?
Thanks for your help.
I ran into the same problem, and I was able to get past it by specifying version 1.3.1 for the mongo, bson, and bson_ext gems. I just put this in my Gemfile:
gem 'mongo', '1.3.1'
gem 'bson', '1.3.1'
gem 'bson_ext', '1.3.1'

What continuous integration servers work well with ruby on rails 3 and mac?

I am using a mac as the server. I need something that works well.
I wanted to use atlassian's bamboo but my attempts have failed. The latest doc I can find on the topic is an old blog post. http://blogs.atlassian.com/news/2009/05/bamboo_customer_8.html which helps very little and results in the error:
...rvm/rubies/ruby-1.8.7-p334/lib/ruby/site_ruby/1.8/rubygems.rb:900:in `report_activate_error': Could not find RubyGem bundler (>= 0) (Gem::LoadError)
I looked at http://rubyforge.org/frs/?group_id=2918 which also appears to be years out of date.
So the question is, which Continuous integration server should I use for my rails 3 project, which I can run on a mac and use .rvm (today in 2011)?
Jenkins is always worked for me, you even have a OSX installer:
http://ingorichter.blogspot.com/2011/04/jenkins-osx-installer.html
CI Joe works fine for me with rails 3 and mac.
Jenkins also seems nice, though, as Ed_ mentioned. Especially the part about the OSX installer.
CruiseControl.rb is a CI written in Ruby and can be used for Rails projects.

How to downgrade Rails version?

I create my rails application in version 3.0.7.
now i want to deploy my application, but the server is only support 3.0.3
how can i downloadgrade my application?
thanks
replace
gem 'rails','3.0.7'
with
gem 'rails', '3.0.3'
in your gemfile
Then run bundle
On a second note why not upgrade the server to rails 3.0.7?
Unless I'm mistaken... you can't. Well, you can, by:
Creating a new app
Bundle-installing all the necessary plugins, gems, etc
Copying over app files, configs, helpers, tests, everything
Running tests and seeing what doesn't now work
Making changes where required
Unfortunately, I don't believe there exists an easier way.