# Rails app works only if created directly on server; transfer

**URL:** <https://www.ruby-forum.com/t/rails-app-works-only-if-created-directly-on-server-transfer/105940>\
**Category:** Deployment\
**Created:** [June 4, 2007, 9:02pm UTC](https://www.ruby-forum.com/t/rails-app-works-only-if-created-directly-on-server-transfer/105940 "2007-06-04T21:02:02Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Gary\_King](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/g/4491bb/32.png) [@Gary\_King](https://www.ruby-forum.com/u/Gary_King)\
**Post date:** [June 4, 2007, 9:02pm UTC](https://www.ruby-forum.com/t/rails-app-works-only-if-created-directly-on-server-transfer/105940/1 "2007-06-04T21:02:02Z")

</div>

Hey guys, I have a Rails deployment issue. If I run the ‘rails  
app\_name’ command on my server directly, then run that, then the app  
runs fine. But, if I run ‘rails app\_name’ on my desktop and then  
upload the app to the server, then I get a ‘xxx failed to start  
properly.’ error. How do I fix this? 😕

---

<div class="post-metadata">

**Author:** ![Gary\_King](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/g/4491bb/32.png) [@Gary\_King](https://www.ruby-forum.com/u/Gary_King)\
**Post date:** [June 4, 2007, 9:11pm UTC](https://www.ruby-forum.com/t/rails-app-works-only-if-created-directly-on-server-transfer/105940/2 "2007-06-04T21:11:06Z")

</div>

What error do you get?

This could be because of different version of Rails on local and remote  
machines? check config/enviroment.rb for rails version the app has been  
created with,  
I have following for a rails application created on my machine,  
RAILS\_GEM\_VERSION = ‘1.2.3’

-Jatinder

---

<div class="post-metadata">

**Author:** ![Gary\_King](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/g/4491bb/32.png) [@Gary\_King](https://www.ruby-forum.com/u/Gary_King)\
**Post date:** [June 5, 2007, 11:46am UTC](https://www.ruby-forum.com/t/rails-app-works-only-if-created-directly-on-server-transfer/105940/3 "2007-06-05T11:46:09Z")

</div>

Jatinder S. wrote:

> What error do you get?
> 
> This could be because of different version of Rails on local and remote  
> machines? check config/enviroment.rb for rails version the app has been  
> created with,  
> I have following for a rails application created on my machine,  
> RAILS\_GEM\_VERSION = ‘1.2.3’
> 
> -Jatinder

#---------------------------------------------

I have the exact same problem and have yet to get to the bottom of this.  
I looked to see which Rails version was on both the server and my local  
machine using the shell command rails -v will output this. They are both  
using Rails 1.2.3 . I don’t know where to look for the bug as all the  
log files found in RAILS\_ROOT/log are blank. Here is what I have learned  
about this issue. The Application Error message found in the “Welcome  
aboard page” and for every method in the controller originates from the  
RAILS\_ROOT/public/.htaccess file. It is triggered by a 500 error from  
the looks of it. I have heard some people say it is a permissions  
problem with RAILS\_ROOT/tmp/sessions so I set chmod 755 /tmp and chmod  
755/tmp/sessions and it still is giving me this error. I am thinking  
this may be my ftp application changing some permissions to files upon  
upload. I would love to hear anyones thoughts on this issue. I made a  
very simple app to test how hard deployment was going to be before I  
built an entire app. Also I can access the database via the irb by  
running the following commands in the ssh shell.

irb

> > MODEL\_NAME.find :all

returns all records found for that model. So I know that this is nothing  
with the database.yml file (I thought windows line breaks may be to  
blame) and the model is working fine.

Regards,

Tim M.

---

<div class="post-metadata">

**Author:** ![Gary\_King](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/g/4491bb/32.png) [@Gary\_King](https://www.ruby-forum.com/u/Gary_King)\
**Post date:** [June 5, 2007, 9:22pm UTC](https://www.ruby-forum.com/t/rails-app-works-only-if-created-directly-on-server-transfer/105940/4 "2007-06-05T21:22:54Z")

</div>

On 6/5/07, Tim M. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> I have the exact same problem and have yet to get to the bottom of this.  
> I looked to see which Rails version was on both the server and my local  
> machine using the shell command rails -v will output this.

1. You shouldn’t have Rails in gems on the production server. It  
should go to vendor/rails of your app (look up Rake task  
rails:freeze:gems). This eliminates the possibility of Rails version  
mismatch. “Vendor everything”

2. You can tell your app to render a development error page (with the  
actual error message and stack trace), by changing this line in  
environments/production.rb:

config.action\_controller.consider\_all\_requests\_local = false  
to  
config.action\_controller.consider\_all\_requests\_local = true

and restarting it.

–  
Alex Verkhovsky  
RubyWorks
