Alpha Blue wrote:
> The title says it all - please bear with me.  To let you know where I
> stand, I have been working for up to 12 hours a day for 2 months and 2
> weeks trying to get my site ready for release.

Yikes!  Please see http://c2.com/cgi/wiki?SustainablePace .

>  In development (on
> windows) it works perfectly.  In production (on linux ubuntu) it does
> not.
> 
> I stopped using capistrano because there are problems with the repo on
> github and things aren't working well with that.  

What problems?  Github generally works very well.

> I figured the easiest
> way for the first time would be to create a separate folder for
> production testing and point my virtual host to that.

You may be right.  But get Cap working once you solve your gem issues.

> 
> I have the following issues from start to finish:
> 
> (Setup: Using ubuntu hardy,

That's 8.04, right?

 apache, passenger, rails 2.3.3, ruby 1.8.6)
> 
> Issue One:  Last night when I did the manual install and went to my
> server, passenger told me that one of my plugin methods wasn't
> available.  I was subsequently told by a friend that you have to include
> "all" gems in environment.rb.  So, I put require next to the gems I use
> in order:
> 
> require "rubygems"
> require "redcloth"
> require "will_paginate"
> require "mysql"

Your friend was incorrect.  Take out the require statements.

> 
> Issue Two: After restarting the server, I was getting an issue about one
> of the constants I have in my environment.  I disabled the constant in
> the two files it exists (because it wouldn't affect things outright).
> When running touch restart.txt and going to my site I'm getting an
> Internal Server Error 500 message.
> 
> I check the logs and there's nothing written to them.  Just one line
> only on production.  Server log has 0.
> 
> # Logfile created on Tue Aug 11 13:26:37 +0000 2009
> 
> So, I'm unable to view errors or figure out what is going wrong with my
> setup.

You're not unable to view errors; rather, your app is not even starting 
(which is why it's not writing anything to its logfiles).  At this 
point, you should look in the Apache error logs for more information.

> 
> Issue Three:  Another person told me that I don't need to require the
> gems in environment rb and that I should just use the config and do a
> rake gems:install so I add them there:
> 
>   config.gem "rubygems"
>   config.gem "redcloth"
>   config.gem "will_paginate"
>   config.gem "mysql"

config.gem is correct, but you should follow the example syntax in 
environment.rb as far as versions go.  (And you shouldn't need to 
require rubygems -- nor, I think, mysql.)

> 
> Run sudo rake gems:install
> 
> WARNING:  Installing to ~/.gem since /usr/lib/ruby/gems/1.8 and
>           /usr/bin aren't both writable.

This is where it gets bizarre.  Sudo should give you write access to 
everything.  Does /usr/lib/ruby/gems/1.8 actually exist?  If not, try 
creating it.


> WARNING:  You don't have /home/jdezenzio/.gem/ruby/1.8/bin in your PATH,
>           gem executables will not run.

And you shouldn't need it in your path, 'cause gem shouldn't have to 
install there.

> 
> GEM ENV:
> 
>   - RUBYGEMS VERSION: 1.3.5
>   - RUBY VERSION: 1.8.6 (2007-09-24 patchlevel 111) [x86_64-linux]
>   - INSTALLATION DIRECTORY: /usr/lib/ruby/gems/1.8
>   - RUBY EXECUTABLE: /usr/bin/ruby1.8
>   - EXECUTABLE DIRECTORY: /usr/bin
>   - RUBYGEMS PLATFORMS:
>     - ruby
>     - x86_64-linux
>   - GEM PATHS:
>      - /usr/lib/ruby/gems/1.8
>      - /home/jdezenzio/.gem/ruby/1.8
>   - GEM CONFIGURATION:
>      - :update_sources => true
>      - :verbose => true
>      - :benchmark => false
>      - :backtrace => false
>      - :bulk_threshold => 1000
>      - :sources => ["http://gems.rubyforge.org/";,
> "http://gems.github.com";, "http://gems.github.com";]
>   - REMOTE SOURCES:
>      - http://gems.rubyforge.org/
>      - http://gems.github.com

This looks pretty good.

However, if you are having problems installing gems on your deployment 
system, the easiest thing to do would be to just unpack the gems into 
vendor and check the codebase into the repo *with gems*.

> ================
> 
> At this point, I took a step back.
> 
> First, this linux is on slicehost and I created and duplicated
> everything I had from windows on it in terms of what gems it needs.
> 
> It has every single gem installed that I have on my development machine.
> The only difference is on windows I don't need to do a require "x-gem
> etc." to get my gems to work.

I'm not sure if you *need* to on Linux either (don't recall for sure). 
But the config.gem statements tell the app right at startup what it 
needs.
[...]
> So, where do I stand?  What are the biggest issues?
> 
> 1.  I can't see errors in my logs to troubleshoot my issues

As I explained above, that is not the problem.  Rather, your app is not 
starting.

> 2.  I'm not sure where I need to require my gems, how to require them
> properly for production, or how to simplify this process to that I can
> access them anywhere.

Learn about rake gems:unpack .

> 3.  The rake gems:install is a bad solution for me because I already
> have the gems installed on my system - my app just needs to be able to
> see them.  Because my app can't see them and I'm forced to use a require
> "rubygems" do I have to include every possible gem my app uses, even
> mysql?

No.  That's what config.gem is for.  Or you could use rake gems:unpack .

> 4.  What other things can I do to troubleshoot my issues here.
> 
> .. Very tired .. and pretty frustrated and sad right now.  I'm losing
> too much time and getting to the point that I can't think straight.

Then just take a break before you start making stupid mistakes.  I know 
it may feel like you have no time to lose here, but trust me, putting it 
all away for a few hours and doing something else will save time.

> I've been told to go here and there, and talk to this person and that
> person, visit this IRC channel and that IRC channel.  At the end of it
> all, I'm not getting the right answers or not getting any answers at
> all.

One other idea: you might want to try deploying an empty Rails app just 
to make sure that Passenger and Apache are working OK together.

> 
> I'm a great troubleshooter.  I don't know how to properly troubleshoot
> this issue correctly.

Best,
--
Marnen Laibow-Koser
http://www.marnen.org
[email protected]
-- 
Posted via http://www.ruby-forum.com/.

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Talk" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to