Rails Reporting Wrong Environment in Multi-stage Setup - ruby-on-rails-3

Using capistrano 2.12.0, capistrano-ext 1.2.1, Rails 3.2.7 and Phusion Passenger 3.0.15.
For no logical reason, my 'playground' server has started reporting that it's actually running in development mode.
I've reinstalled things, restarted apache etc but am still stuck.
Don't really want to hardcode as I've got a production environment to think about.
In my apache conf. I've set
RailsEnv playground
There's a gist of my deploy.rb file here
Capistrano is sending to the correct location etc. so I think it's rails or passenger rather than cap.
What else can I do to get this going properly??
---- EDIT ----
I've just tested with Unicorn and it's also reporting that it's running in development mode.
Starting unicorn with the following:
unicorn -E playground -l 8000

After much experimentation, I found the root cause to be a line in one of my models:
- if Rails.env = 'development'
Obviously, this should have been a '==' not a single one.

Related

passenger-memory-stats works, passenger-config validate-install works fine, passenger-status says not running?

Centos 7 server. Passenger installed with gem
As per title:
$ passenger-config validate-install
"Everything looks good :-)"
$ passenger-memory-stats
All the details of apache and passenger running.
I can go to the site and it works fine.
passenger-status output says "ERROR: Phusion Passenger doesn't seem to be running..."
I haven't customized any directories or done anything unusual up to this point that I'm aware of but passenger-status is apparently looking in the wrong place.
Suggestions on how to fix please?
Thanks

LoadError: no such file to load -- rack/handler/glassfish

I have Successfully installed glassfish-1.0.3-universal-java, but when I run Rails Server using the command Jruby -S rails server glassfish. The output is follows:
f:\Program Files\BitNami JRubyStack\jruby\depot>Jruby -S rails s glassfish
Exiting
LoadError: no such file to load -- rack/handler/glassfish
require at org/jruby/RubyKernel.java:1033
try_require at F:/Program Files/BitNami JRubyStack/jruby/lib/ruby/gems/1.8/gem
s/rack-1.4.1/lib/rack/handler.rb:63
......
Any questions? Should I run Tomcat or Glassfish first?
You don't need to run rails server anymore, you just run glassfish.
f:\Program Files\BitNami JRubyStack\jruby\depot>glassfish
That will start up glassfish for your depot project. Check out their documentation for a little more information about this. That being said I think the glassfish project is kind of dying. From what I understand Oracle has killed glassfish (http://www.infoq.com/news/2010/04/glassfish-gem-alternatives-jruby). I would take a look at using Trinidad or Torquebox as alternatives.

How do I ensure my jruby command line options are used when running "rails", "rake", "rspec" etc?

I currently run my Rails app using:
jruby --1.9 -J-XX:+CMSClassUnloadingEnabled -J-XX:+UseConcMarkSweepGC -J-XX:MaxPermSize=256m -S rails server
This is getting pretty old now. How can I set my Rails project up so that just running
rails server
has the same effect?
(Note: bash aliases and the like are not what I'm looking for here. I want to make the project work right, not fix my local settings)
When using RVM and a project .rvmrc, the canonical way is to set PROJECT_JRUBY_OPTS in the project .rvmrc. A bug prevented this from working for me, so use rvm head.
If not using rvm then use JRUBY_OPTS, which is the built-in way of doing it that JRuby checks (in fact, the PROJECT_JRUBY_OPTS thing ends up being converted to JRUBY_OPTS by rvm).

Phusion Passenger ngnix.conf location

I have a Rails 3 application that uses Phusion Passenger. I install the standalone version of Passenger using the command "gem install passenger" on my Macintosh MacBook Pro. The application works fine. Now, I want to change some configurations for the ngnix server but I can not find the location of the ngnix.conf file. I have looked in /usr/local and /opt/ and /etc/. Can someone assist me in either finding or creating the ngnix.conf?
Thanks
Look for the nginx.conf file in /opt/nginx/conf
You must have su privileges to edit this file.
Remember to stop and start nginx after making your changes

setting production environment in rails 3.0

How is the environment set in Rails 3.0?
In Rails 2.x, environment.rb contained a line setting RAILS_ENV to production. It was commented out in the generated file. To force a production environment, uncomment that line.
Rails 3.0 contains no such line in environment.rb, and RAILS_ENV is deprecated. Is there something missing, or is the environment set when the server is started (eg "start Mongrel_rails -e production ..."
I'm trying out Rails 3.0 on my deployment host and getting some odd behavior. Specifically, it seems to be trying to load the :development object from database.yml, and it seems to be ignoring the :groups => :development option in the gemfile. Consequently the app is trying to use Sqlite3 on the deployment server where it is not available.
The replacement is Rails.env
I set the environment in my server config.. thin.yml, mongrel_cluster.yml, or whatever server I am using.
When you are using Cap, how do you call "bundle install"? You should be using the --deployment flag when deploying to prod. It would be helpful to see your deploy.rb file.