Weird Facebooker Plugin & Pushion Passenger ModRails Production Error - ruby-on-rails

I have an application (Rails 2.3.5) that I'm deploying to production Linux/Apache server using the latest Phushion Passenger/Apache Module 2.2.11 version. After deploying my original application, it returns a 500 error with no logging to production log.
So I created a minimal test rails application, with some active record calls to the database to print out a list of objects to the home controller/my index page. I also cleared out all plugins. That works fine in the production environment. Then I one by one introduced each plugin that I'm using one at a time.
Every plugin works fine EXCEPT facebooker. Every time I load the facebooker plugin into my app/vendor/plugins directory (via script git etc) my test application break (500 error - no error logging). Everytime I remove the facebooker plugin my test application works.
Has anyone seen this before/ have any solutions? I saw this solution but didn't see it in the facebooker code.

Did you add Facebook credentials for production environment?

Related

Error when trying to view uploaded ruby on rails application on Heroku

I'm having problems with trying to view my first Ruby on Rails application on Heroku as a user called LHH has helped me with the first problem which has been about an error uploading but anyway, that has been fixed and now I'm having the problem where I cannot view the application as I am getting the following error.
"We're sorry, but something went wrong. If you are the application owner check the logs for more information"
Error - http://prntscr.com/aepg5c
I opened the log for the deploy that claims it was successful and this is the complete log in this screenshot - http://prntscr.com/aerjnv
I'm not really one to be using ruby on rails as this is my first application that worked and I don't use the Heroku toolkit so what I'm doing is linking it to github via the browser page and telling it where to get the files and the reason why I'm not using the command line is because for some odd reason the Heroku toolkit isn't working with my Windows 10 system.
Open your Gemfile.lock and remove
PLATFORMS
x86-mingw32
then add and try to push on heroku.
PLATFORMS
ruby
for more check here https://devcenter.heroku.com/articles/bundler-windows-gemfile

Rails not writing to development log

My Rails app (version 4.0.3) is not logging anything in dev. My development.log (as well as test.log) were last touched on 12/12/2013, which is the day I created the project. So logging has evidently never worked in dev or test. (Production seems to be working just fine, FWIW.)
It doesn't seem to be a permissions issue; my log directory is recursively 777'd.
I've restarted my server after ensuring the permissions are good, so it's not that.
Any ideas?

Torquebox - project is not updated

I have installed:
Ubuntu 12.10
jruby 1.7.3
ruby 2
rails 3.2.13
RubyMine 5
DB2 C-Express
I have create a sample application and connected it correctly to the database - I know this because I have successfully executed the scaffold and migrate commands and check that the tables are created.
Then I have run the following commands in order to deploy my application with torquebox 2.0:
torquebox deploy
torquebox run
I have run these commands in my project folder and as a result on localhost:8080 I am seeing rails start page. I have the following issues:
Clicking on "About your application’s environment" tab I am getting the following error:
javax.servlet.ServletException: org.jruby.exceptions.RaiseException:
(NameError) cannot link Java class com.ibm.db2.jcc.DB2Driver, probable
missing dependency: Could not initialize class
com.ibm.db2.jcc.DB2Driver
org.torquebox.web.servlet.RackFilter.doRack(RackFilter.java:117)
org.torquebox.web.servlet.RackFilter.doFilter(RackFilter.java:101)
org.torquebox.web.servlet.RackFilter.doFilter(RackFilter.java:72)
org.torquebox.web.servlet.SendfileFilter.doFilter(SendfileFilter.java:49)
org.torquebox.web.servlet.SendfileFilter.doFilter(SendfileFilter.java:33)
I believe this is because the torque box is not able to find the driver. But why as it is vissible in my rails application and I successfully created/migrate tables from it using the terminal? Should I put the driver somewhere else,too?
Then I the torque box documentation is said:
Changes to your Rails application show up immediately in the browser,
as expected. When you're done, press CTRL+C in the terminal to stop
TorqueBox before continuing with the next steps.
But that's exactly what I have had to do in order to refresh the content of the page. I have changed my gem file and database.yml file but refreshing the page did not reflect this. After I have stop the server and start it again it shows something different.
Could you advise or tell me what I am doing wrong?
Without restarting the Torquebox server your can redeploy the knob with touch just run
touch $TORQUEBOX_HOME/jboss/standalone/deployments/your_apps-knob.yml.deployed
this way you don't have to restart whole JBOSS server.Deployment via descriptor
For production setups you can use Capistrano Torquebox Capistrano support

rails app - sudden 403 after pull - how do I start to debug?

I'm been working on a rails 3.1 app with one other dev.
I've just pulled some of his recent changes, using git. And am now getting a 403 on any page I try to visit.
You don't have permission to access / on this server.
I'm running the site locally through passenger.
Oddly, when I start the app using rails' internal server. I can visit the site at http://0.0.0.0:3000
Looking at the changes in this recent pull, the only files have changed are some javascripts, some html the application.rb, routes.rb and a rake file.
How do I debug this, I'm a bit lost on where to start?
EDIT:
If I roll back to an earlier version the site works, through passenger. Which leads me to believe the problem is within the rails app, rather than an Apache error. Or it could be a permissions thing, can git change file permissions in this way?
IMHO this is a configuration error in Apache or wrong directory layouts. Make sure that the passenger_base_uri still points to the public folder inside your rails project and that there are no hidden .htaccess files which block access. Also verify that your sym-links are correct (if there are any). Also check your Apache error log.
Start by launching your console to see if rails and your app can be loaded.
In your application root directory type :
rails console

Railties in Rails 2.3 project?

I've inherited a small Rails project from a new client and unfortunately the previous developer(s) left essentially no information other than the Rails app instance running in production. (No source repository, no documentation, just the login to the production server.)
Inspecting the server shows Rails version 2.3.8 installed (confirmed by the version number in "config/environment.rb") but when I try to run "ruby script/console" (or "server") on my local dev environment I get (essentially fatal) error messages originating from files in "vendor/rails/railties" and searching the internet for "railties" shows a lot of Rails 3 documentation.
I'm guessing that a previous developer/maintainer crossed the Rails 2/3 streams somehow. Should I be ok to just delete the entire "vendor/rails" directory or am I missing something?
What kind of error are you getting? Do you know that your local environment is the same as production? Do other Rails 2.3.8 projects run fine on your machine?
Now, I think it should be fine to remove vendor/rails with the exception being that if the previous developer monkeypatched something in Rails, but directly in the vendor/rails directory. Then, you might have a problem.
This approach might be a bit tedious, but I might go as follows:
Clone 2.3.8 somewhere else on my machine.
Check it in to some form of version control.
Copy your version of 2.3.8 from the project into the newly cloned directory.
Diff it.
This should show you if the previous developer made any changes, both significant and insignificant, to Rails.
Good luck, because this doesn't sound very fun :(

Resources