Go Back   HostGator Peer Support Forums > HostGator Announcements > General Announcements

Notices

Reply
 
Thread Tools
  #176  
Old 06-20-2009, 11:48 AM
CNES CNES is offline
Hatchling Croc
 
Join Date: Jun 2009
Posts: 1
Default Re: Ruby on Rails Support

Has anyone here had any success installing an app like "typo"? I keep getting an application error.
Reply With Quote
  #177  
Old 06-20-2009, 11:50 PM
GatorJReynolds
HostGator Guest
 
Posts: n/a
Default Ruby on Rails Support

Hi Everyone!
We've gone through a lot of changes since we initially rolled out our RoR support and the first tutorial for our customers was posted. For starters, we now support RoR via FastCGI. Additionally, we now support eruby on request, for for all of you who would like to design a ruby web application without the help of the rails framework, you can now request that this be enabled for your account.

This is a small tutorial on setting up, configuring, and troubleshooting your rails application.

Prerequisites are having jail-shell enabled on your account. If you do not have this enabled, you can contact us and it is free to enable this for your primary account.

Before you begin: Check to see if the rails version on the server is adequate for your needs. You can do this by typing the following at the command line:

Code:
 user@host $ rails -v
 Rails 2.2.2
Not all of our servers use the same rails versions, so this is something important to note. If you find that the version of rails installed on the server is not the version you developed your rails application, you will need to do what is called freezing your application before uploading it to our servers. To do this, you can do the following
in your local command line (example is for rails 2.3.2):
Code:
user@host $ rake rails:freeze:gems
user@host $ rake rails:freeze:edge RELEASE=2.3.2
Then, on our servers, you will need to run:

Code:
user@host $ rake rails:update:configs
Getting Started:
To create your own rails application, in stead of using "rails appname", we recommend that you use the following command string:
Code:
user@host $ rails -d mysql --with-dispatchers railsapp
This will create a default rails application with the name "railsapp" in the directory you are located in. In order to set the application up, we recommend you run the above command in /home/YOUR_USERNAME_HERE , commonly known as ~. So you can always:
Code:
user@host $ cd ~
To get to this directory. Once you've created a rails application called "railsapp" in your home directory, you should take a moment to modify a few of the configuration settings. Because we're working with FastCGI now, you will have to modify your testapp/public/.htaccess file to contain the following handler for FastCGI, and you may have to modify the rewrite rule as well, so that the handler and the rewrite are changed in this way:
AddHandler can be changed from :
Code:
AddHandler fastcgi-script .fcgi
To
Code:
AddHandler fcgid-script .fcgi
Rewrite can be changed from:
Code:
RewriteRule ^(.*)$ dispatch.cgi [QSA,L]
To
Code:
RewriteRule ^(.*)$ dispatch.fcgi [QSA,L]
If no .htaccess comes with your application, you can find one in the README located in testapp/ . You will notice in the README that instructions are provided for modifying the .htaccess to allow a folder
to exist without being called as a model, view, or controller:

Code:
    RewriteCond %{REQUEST_URI} ^/notrails.*
    RewriteRule .* - [L]
Where "notrails" is a folder that contains images or non-rails data.
Now you are ready to set up the public directory. To do this, assuming you want the public_html to be your rails application, you would erase public_html and run the following:
Code:
user@host $ ln -s testapp/public ./public_html
If you'd like to set this up with an Add-On domain, go ahead and create the Add-On domain in your cPanel, then remove its directory from your public_html. After which, you would run:
Code:
user@host $ ln -s testapp/public ./public_html/addondomain.com
Now we're ready to configure your application.

Configuration:
Because we're using FastCGI, it will be a main instance of a FastCGI which runs your application. This means that you do not "start" and "stop" your application as you normally would. In stead, there is a constantly running process, which can create problems if the connection to the MySQL server is lost. To mitigate this, make the following change to
testapp/config/database.yml:
Code:
reconnect: true
Additionally, due to the nature of our environment, you may have to change:
Code:
socket: /tmp/mysql.sock
To:
Code:
socket: /var/lib/mysql/mysql.sock
If you're running your rails application out of the document root of a domain, or domain.tld/, there won't be too much of an issue with the next potential problem. However, if you are running this out of a directory, like yourdomain.com/rails, you will need to make the following modification to
config/environment.rb :
Code:
ENV['RAILS_RELATIVE_URL_ROOT']="/rails"
Because "/rails" is the folder that the application will be running out of. You can change this when you change the directory names. If you change to production mode or development mode or test mode, you may need to add this to the config/evironments/production.rb, config/evironments/development.rb, or config/evironments/test.rb, respectively.

Logging: Typically the logs for a rails application are stored in log/development.log or the appropriate environment for your application. Sometimes though, this is not available. If this is the case, you will want to check your error log from your home directory.

Troubleshooting:
There are a couple of steps that you can take before filing a support ticket or contacting our live representatives to determine whether this is a problem with rails on the server, or a problem with code inside the application. We'd ask that users take these
steps before submitting a support request if at all possible.
Ruby provides a debugger and interpreter which you can write applications in on-the-fly. This also helps to determine if there is any issue with a specific line of code. The interpreter, which many of you are most likely familiar with, is called "irb". To access
this, you can simply type:
Code:
user@host $ irb
You can use this tool to diagnose if the issue is related to a gem:
Code:
user@host $ irb
 irb(main):001:0> require 'mysql'
 => true
 irb(main):002:0>
If you want to see if there are any syntax errors in your application, you can run the following from the root of the application, in this example, ~/testapp/ :
Code:
user@host $ find -name \*.rb -exec ruby -c '{}' \;
If the syntax checks out okay, but you have a "No Routing" error, you may need to re-read the README file. If the above steps have been taken and you are unable to get the application working, you may need to contact support.

Contacting support:
If possible, please have the error logs in your original request for support regarding ruby on rails tickets. For example, if you are having an issue with the mysql gem, you could provide something along the lines of the following IRB output:
Code:
irb(main):001:0> require 'mysql'
 LoadError: /usr/lib/libmysqlclient.so.15: version `libmysqlclient_15' not found (required by /usr/lib/ruby/site_ruby/1.8/i386-linux/mysql.so) - /usr/lib/ruby/site_ruby/1.8/i386-linux/mysql.so
       from /usr/lib/ruby/site_ruby/1.8/i386-linux/mysql.so
       from (irb):1
This will help us to faster diagnose and correct the issue. It will also help us to know the exact path of the Rails application, or a URL where the application can be seen, so that we can get to the application as quickly as possible and determine the source of the issue.

Last edited by GatorJReynolds; 06-20-2009 at 11:59 PM. Reason: formatting
Reply With Quote
  #178  
Old 07-19-2009, 11:29 PM
jporter jporter is offline
Hatchling Croc
 
Join Date: Jul 2009
Posts: 1
Default Re: Ruby on Rails Support

I recently struggled (but eventually succeeded) in getting a locally created app uploaded and running on a hostgator shared server. For a first-time ROR deployment it was pretty frustrating so I've written a summary for first timer's like me below. (Written: 20/7/09)

(if you're familiar with SSH skip this first section)

SSH ACCESS

You will have to have to request jailed SSH access on your Hostgator account by submiting a support ticket. You can then use SSH to execute commands (rake, script/generate etc) like you would locally.
To log in to SSH run:
Code:
ssh -p 2222 username@primarydomain.com
CREATE APP

Even though you have created your app locally, you want to create a new app in SSH (and let it create the folder hierarchy) and then replace all the controllers/views/models/db/config etc with your app.

To create the new app in SSH:
First navigate to a location where you want to create the new app folder – it doesn't matter where although cpanel likes to put them in ~/etc/rails_apps/.
Run:
Code:
rails -d mysql --with-dispatchers mynewapp
You now need to upload your locally created app to the hostgator server using FTP or otherwise.
If you're running Win, I've heard a lot of people rave about Filezilla, If you're on linux – I suggest avoiding gFTP (It kept crashing due to the ~100 folder hierarchy typical in a rails app), I used Krusader.

Don't overwrite the files yet! Create another folder out of the way and upload it there for now. You have to be careful when overwriting the ssh created app that you don't accidentally wipe some necessary files.

You can completely overwrite all files and folders EXCEPT the public folder. When dealing with the public folder, I suggest you overwrite the individual images, stylesheets and javascripts folders without touching the files already in /public/.

Specifically: public/dispatch.rb , public/dispatch.cgi and public/dispatch.fcgi must all be present otherwise your app will not function.

Once you've got your locally created app in place go on..

.HTACCESS

To get the app running properly it is necessary to edit .htaccess.
Navigate to ~/etc/rails_apps/mynewapp/public:
Code:
cd /etc/rails_apps/mynewapp/public
To open .htaccess:
Code:
pico .htaccess
Regardless of whether there's already text in the file or its blank, the only necessary code (I got from a Hostgator ticket) is as follows:

Code:
AddHandler fcgid-script .fcgi 
     AddHandler cgi-script .cgi 
     Options +FollowSymLinks +ExecCGI 
  
     RewriteEngine On 
     RewriteCond %{REQUEST_URI} ^/notrails.* 
     RewriteRule .* - [L] 
  
     RewriteRule ^$ index.html [QSA] 
     RewriteRule ^([^.]+)$ $1.html [QSA]     
     RewriteCond %{REQUEST_FILENAME} !-f 
     RewriteRule ^(.*)$ dispatch.fcgi [QSA,L]
Save the .htaccess file

DATABASE SETUP

In cpanel go to MySQL databases and create a new database:
eg. New database: records

Note that cpanel will automatically add username_ to the front of it, thus database name is:
username_records
You also need to create a user for this database:
eg. Username: jsmith
pw: *****
Note that cpanel will also append username_ to the front of each user toO, thus database user will be:
username_jsmith

Finally in cpanel Add user to database: username_jsmith to username_records.

You can now use this database, username and password in database.yml

DATABASE.YML

in SSH or filemanager:

Code:
cd /etc/rails_apps/mynewapp/config/
         pico database.yml
Setup database.yml for above example:

Code:
development:
   pool: 5
   timeout: 5000
   adapter: mysql
   database: username_records
   username: username_jsmith
   password: *******
   socket: /var/lib/mysql/mysql.sock
  
 # Warning: The database defined as "test" will be erased and
 # re-generated from your development database when you run "rake".
 # Do not set this db to the same as development or production.
 test:
   adapter: sqlite3
   database: db/test.sqlite3
   pool: 5
   timeout: 5000
  
 production:
   adapter: mysql
   username: username_jsmith
   password: *******
   socket: /var/lib/mysql/mysql.sock
   pool: 5
   timeout: 5000
   reconnect: true
   socket: /var/lib/mysql/mysql.sock
Notes: LEAVE TEST ALONE (if you setup test like the prod and dev you might accidentally wipe the database if you run a test). Take note of the adapter and socket, they need to be setup for mysql not sqlite.

SYMLINK

Currently we have the app loaded at /etc/rails_apps/mynewapp. However, pages that are visible on the web need to be in the /public_html/ directory. Because of the way rails separates public from models/views etc, we use a sym link to make the files from /mynewapp/public appear also in /public_html/. It will essentially seem like the one folder (public) has 2 different paths to it.

A few variables: Do you want the app to be displayed at www.mydomain.com/ or www.mydomain.com/blog/? Do you have addon-domains or is this your only domain?

CASE: Display at mydomain.com/ and YES I have addon domains

If we want to display at mydomain.com/ we need to create a symlink to /public_html/. The issue is that you must delete public_html and then recreate it with the symlink. (can't symlink to an existing folder) As you probably know, addon domains are stored in /public_html/addondomain.com/. To ensure that you don't loose you addon domain data it is necessary to:
  1. copy the addondomain.com folder/s elsewhere
  2. delete public_html
  3. create the symlink (which will recreate /public_html)
  4. Copy the addondomain.com folder/s back to their original location
So assuming you've backed up you addon domains and deleted public_html:

In SSH (at /home/username/) execute:
Code:
ln -s ~/etc/rails_apps/mynewapp/public ~/public_html
You will now find that in public_html you have the files and folders (images/stylesheets etc..) that are located in /mynewapp/public. Don't forget to copy back you addon domains.

This is the hardest scenario, if you have no addon domains – obviously the same procedure applies without needing to backup anything.

If you want the rails app to display on an addon domain:
Code:
ln -s ~/etc/rails_apps/mynewapp/public ~/public_html/addondomain.com
If you want the rails app to display at mydomain.com/blog: (ensure no folder named blog exists)
Code:
ln -s ~/etc/rails_apps/mynewapp/public ~/public_html/blog
also add to mynewapp/config/environment.rb:
Code:
ENV['RAILS_RELATIVE_URL_ROOT']="/blog"

ENVIRONMENT.RB


At the top of the file I added:
Code:
ENV['RAILS_ENV'] ||= 'production'
In the Rails::Initializer.run do |config| block:
Code:
config.load_paths += %W( #{RAILS_ROOT}/vendor/plugins )
GEMS

You can also have problems if you are using gems in your app that hostgator hasn't got installed. You can view which gems are installed in cpanel RubyGems and also install gems through cpanel. I was unsuccessful at correctly pathing to them in my app – so instead send a support ticket and ask for which gems you would like installed on the server and Hostgator will do it in a few hrs.

TROUBLESHOOTING

Hopefully that's it and your app is now working.

If you're not having any luck I reiterate: make sure you didn't overwrite anything important when uploading your local app. Specifically: public/dispatch.rb , public/dispatch.cgi and public/dispatch.fcgi must all be present otherwise your app will not function. (this caused me some headaches).

Also you can sometimes ID errors by running “ruby script/console production” in SSH from your mynewapp dir.
Reply With Quote
  #179  
Old 09-14-2009, 08:59 AM
GatorBHusbands's Avatar
GatorBHusbands GatorBHusbands is offline
HostGator Staff
 
Join Date: Apr 2009
Posts: 14
Default Re: Ruby on Rails Support

Hello all,

As you know we have gone through changes for ROR apps on our servers. Here is the latest quick start instructions.

1. go to the dir in which you want to store the app
2. make app:
rails --with-dispatch appname
3. go into the README and copy the section:
Apache .htaccess example
4. put this in the .htaccess file in public
5. change in what you just pasted the following:
AddHandler fastcgi-script .fcgi
to
AddHandler fcgid-script .fcgi
And
RewriteRule ^(.*)$ dispatch.cgi [QSA,L]
to
RewriteRule ^(.*)$ dispatch.fcgi [QSA,L]
5.(a) just for ref you find out what to change the first one to from here:
/usr/local/apache/conf/includes/pre_main_2.conf
6. make a symlink for app
ln -s /path/to/public /home/username/public_html/link

to have rails use mysql:
1. rails --with-dispatch -d mysql appfolder
2. create mysql database
3. set the username and password in database.yml

if you need to install fcgi for rails:
gem install fcgi -- --with-fcgi-dir=/opt/fastgcgi/

if you get a route error:
in config/environment.rb put:
ENV['RAILS_RELATIVE_URL_ROOT']="/link"

kill the fcgi proccess:
killall -9 dispatch.fcgi
Reply With Quote
  #180  
Old 09-20-2009, 02:04 AM
felleman felleman is offline
Hatchling Croc
 
Join Date: Aug 2008
Posts: 3
Default Re: Ruby on Rails Support

Hi,

After following these steps I am not able to connect via web server. The database connection and the application seem okay. I can run "ruby script/console" and manually create and read database objects. However, when I post to the web server, I get a disconnect error on the client and a bunch of entries in fastcgi.crash.log, starting with:

Dispatcher failed to catch: uninitialized constant Rack::Handler::FastCGI (NameError)

Help?
Reply With Quote
  #181  
Old 09-20-2009, 10:48 AM
felleman felleman is offline
Hatchling Croc
 
Join Date: Aug 2008
Posts: 3
Default Re: Ruby on Rails Support

To be more precise:
If I view "http://www.<username>.com/<appname>", I get the "Welcome Aboard" message I expect.

However, if I create a model and controller, then try to view "http://www.<username>.com/<appname>/<modelname>" I get the error. It appears that somehow the dispatch is failing.

I'm a newbie on the dispatch mechanism, so I'm having a hard time getting past this.

Thank you.
Reply With Quote
  #182  
Old 09-20-2009, 08:55 PM
jhong jhong is offline
Hatchling Croc
 
Join Date: Jul 2009
Posts: 1
Default Re: Ruby on Rails Support

The symlink doesn't want to work unless you submit a ticket..

ln -s /home/username/railsappdirectory/public /home/username/public_html always wants to create a public folder within it, so it looks like public_html/public.

Is there a fix for this?
Reply With Quote
  #183  
Old 09-20-2009, 09:04 PM
felleman felleman is offline
Hatchling Croc
 
Join Date: Aug 2008
Posts: 3
Default Re: Ruby on Rails Support

jhong,

If you use the command:
ln -s /home/<username>/<railsappdirectory>/public /home/<username>/public_html/<railsappdirectory>

you will get what you want. Equally easy is to:

cd /home/<username>/public_html
ln -s ../<railsappdirectory>/public <railsappdirectory>

For example, if your app dir is named "helpermonkey", go to public_html and type:
ln -s ../helpermonkey/public helpermonkey

You can check this with the "ls -l" command which shows the value of a symlink.

Regards,
John
Reply With Quote
  #184  
Old 10-21-2009, 11:49 AM
Nss Nss is offline
Hatchling Croc
 
Join Date: Oct 2009
Posts: 2
Default Re: Ruby on Rails Support

What about passenger?? Are you thinking about?? Are there some possibilities to have that support?

Why if i use the cpanel for setting up a new RoR application it don't set the --with-dispatch option??

Thanks, Luca
Reply With Quote
  #185  
Old 10-26-2009, 05:35 PM
GatorChad's Avatar
GatorChad GatorChad is offline
HostGator Staff
 
Join Date: May 2005
Posts: 356
Default Re: Ruby on Rails Support

Luca, we're testing out a few servers with Passenger now. It looks promising, and I think we'll be able to include it in the near future with our hosting.
Reply With Quote
  #186  
Old 10-28-2009, 11:35 AM
manna manna is offline
Hatchling Croc
 
Join Date: Oct 2009
Posts: 4
Default Re: Ruby on Rails Support

Are any of the old posting about starting ROR still valid? I used the Manage Ruby on Rails Applications icon from cpanel (X3) and got the ROR intro page up right away on my main domain (i.e. www.mydomain.net). My problem now is when I started second ROR application using the same tool from cpanel, i.e. I want to run second ROR application using www.mydomain.net/secondApp. Here, I got Routing Error. The cpanel tool seems to create all the ROR folders and files (in /etc/ruby_applications/secondApp versus in /etc/ruby_applications/firstApp). The cpanel tool also provides a mean to "rewrite" which dircts port request to ROR app in addition to start and stop the applications. I am new with ROR and the share hosting in general. Have anyone use this cpanel tool to bring up ROR app? Can it be used to start second ROR app like it appears to be providing? Can anyone tell me how the routing in the share server is done in this case? Typically, there should be dispatch files (dispatch.cgi, dispatch.fcgi, or dispatch.rb) in the public folder of the ROR app folder. I did not see any of them even on the first ROR app which appear to be working. Thank you for your helps.
Reply With Quote
  #187  
Old 10-30-2009, 04:11 PM
manna manna is offline
Hatchling Croc
 
Join Date: Oct 2009
Posts: 4
Default Re: Ruby on Rails Support

John,

Did you ever get your problem resolved on your post dated 9/20/09 about getting error after you created controller and view? I just started on the ROR and have the hell of a time getting anything to run other than the Welcome page. I used combination of the cpanel (x3) ROR tool and followed some of the posts found here. I don't know what the cpanel tool does. After following the post here, I get the welcome page regardless of whether the ROR is running or not (as commanded by the cpanel tool). I created a simple controller and not able to get to it and stuck at Routing Error. If you fixed your problem, please share your data. Thank you.
Reply With Quote
  #188  
Old 10-31-2009, 07:10 AM
navidurrahman navidurrahman is offline
Hatchling Croc
 
Join Date: Oct 2009
Posts: 2
Default Re: Ruby on Rails Support

Hi,

I am trying to deploy my application on this url.
http://www.dowsumi.com/pmp/

But it shows the listing of public folder.
One thing more i want to confirm, i have started the Mongrel from shell. and it shows the server is running on 3000 port.
How can i access the site i have tried http://www.dowsumi.com:3000/ but its not working.

I have spent 2 days but unfortunatly not configured.

Please help, Thanks in advance
Reply With Quote
  #189  
Old 11-02-2009, 01:22 AM
Tree of Life (c) Tree of Life (c) is offline
Hatchling Croc
 
Join Date: Nov 2009
Posts: 2
Default Re: Ruby on Rails Support






Newbie Requesting Specific Guidance Re Symlink for Redirecting incoming all lower case URL to Mixed Case URL




Hi,

I'd like to have traffic coming to my site that is using http://adamah.org/treeoflife.lan.io/whatever... be redirected to http://adamah.org/TreeOfLife.lan.io/whatever... ["whatever..." means different URLs as requested by the incoming traffic.] As you can see, the incoming string is using all lower case lettering for the Added Domain "TreeOfLife.lan.io," which doesn't automatically work with HostGator's Linux based system.

The Jazzery J. on the HostGator Staff has told me that a symlink could be used for that purpose and Michael S. and Stephen N. helped me get a php.ini into my root directory. [HostGator Ticket BFF-12615905]

How exactly do I go about making the above work?

Where do I go from here?

- I'm a Newbie at this and I don't know if I can understand your lingo enough to make this work???




Tree of Life (c)

Last edited by Tree of Life (c); 11-02-2009 at 01:31 AM.
Reply With Quote
  #190  
Old 11-03-2009, 03:59 PM
manna manna is offline
Hatchling Croc
 
Join Date: Oct 2009
Posts: 4
Default Re: Ruby on Rails Support

navidurrahman,

Your site www.dowsumi.com/pmp shows the ROR Welcome aboard page. So, it seems to be working. You can tried create controllers and views for it and check it again. If you created the rewrite in .htaccess file in your project public folder and symlink from public_html to your project public folder, then it should works. I also had hard time getting started, but I found following JPorter's posting (7/2009) very helpful. I tried creating the ROR via cPanel (X3), but it only leads to more problem. I followed JPorter's posting and my ROR project is now working as expected.
Reply With Quote
  #191  
Old 11-03-2009, 04:16 PM
manna manna is offline
Hatchling Croc
 
Join Date: Oct 2009
Posts: 4
Default Re: Ruby on Rails Support

Tree of Life,

I am also a newbie, but you can try this:

from your shell window, go to your main domain public_html folder, then create a symlink to your subdomain public folder:

ln -s ~/YourMixCaseDomainFolder/public ~/public_html/YourMixCaseDomain

What this will do is creating a symbolic link between the symbol YourMixCaseDomain to the public folder of your YourMixCaseDomainFolder subdomain. So, when a request comes into your main site (public_html), it will find the symbolic link and sends request to your subdomain public folder. You can check the link by type: ls -la

I hope this help a little...good luck.
Reply With Quote
  #192  
Old 11-07-2009, 09:24 PM
anraiki anraiki is offline
Hatchling Croc
 
Join Date: Apr 2009
Posts: 3
Default Re: Ruby on Rails Support

I am having problem getting my APP up.

There are two alternative I can work here:

1. Is install the App through Cpanel, and having a Subdomain redirected to that App folder.

However, it may show the "Welcome" page. I can not access any of my controllers. It also shows a broken "Welcome" Page: The RoR Icon is missing and I can only see the text.

The 2nd one is that I am creating the App through SSH. There are two things that I believe I am suppose to do. 1. Create the app with a Dispatched, 2. Edit the .htaccess file to the right dispatched.

My problem here is that the dispatched.cgi is not being created, how can I get my app to work?

Please advise. Thank you.
Reply With Quote
  #193  
Old 11-08-2009, 01:33 PM
Tree of Life (c) Tree of Life (c) is offline
Hatchling Croc
 
Join Date: Nov 2009
Posts: 2
Red face Re: Ruby on Rails Support





Quote:
Originally Posted by manna View Post

Tree of Life,

I am also a newbie, but you can try this:

from your shell window, go to your main domain public_html folder, then create a symlink to your subdomain public folder:

ln -s ~/YourMixCaseDomainFolder/public ~/public_html/YourMixCaseDomain

What this will do is creating a symbolic link between the symbol YourMixCaseDomain to the public folder of your YourMixCaseDomainFolder subdomain. So, when a request comes into your main site (public_html), it will find the symbolic link and sends request to your subdomain public folder. You can check the link by type: ls -la

I hope this help a little...good luck.




Thank you Manna,


I sure appreciate your response, but I don’t quite understand how to follow your instruction…

If you could please expand on these words of yours:

Quote:
Originally Posted by manna View Post
then create a symlink to your subdomain public folder:

ln -s ~/YourMixCaseDomainFolder/public ~/public_html/YourMixCaseDomain
1. Is the line “ln -s ~/YourMixCaseDomainFolder/public ~/public_html/YourMixCaseDomain” a one line instruction I place within the code of a file, or what do I do with it? If so, in which file or files?

2. What does “ln –s” mean?

3. What exactly is the difference in my case between “YourMixCaseDomainFolder” and “YourMixCaseDomain” ?

As you can see I am very much of a Newbie…

I appreciate any further help you’ll provide!






Tree of Life ©
Reply With Quote
  #194  
Old 11-17-2009, 05:15 PM
GatorChad's Avatar
GatorChad GatorChad is offline
HostGator Staff
 
Join Date: May 2005
Posts: 356
Default Re: Ruby on Rails Support

Quote:
1. Is the line “ln -s ~/YourMixCaseDomainFolder/public ~/public_html/YourMixCaseDomain” a one line instruction I place within the code of a file, or what do I do with it? If so, in which file or files?
This should be run ssh. If you don't have ssh access, you can request it here: https://secure.hostgator.com/sshrequest.php.

Quote:
2. What does “ln –s” mean?
This creates a symbolic link. Basically the first argument after `ln -s` is the current location, and the second argument is where you want the link to be. Essentially you're making the app public.

Quote:
3. What exactly is the difference in my case between “YourMixCaseDomainFolder” and “YourMixCaseDomain” ?
Typically you'll setup your rails app in your /home/user folder, using any name you want for your app. Then you will create a folder under your public_html that this app will run under, or you can make it run directly under public_html.
Reply With Quote
  #195  
Old Yesterday, 02:27 PM
AirplaneGuy AirplaneGuy is offline
Hatchling Croc
 
Join Date: Nov 2009
Posts: 2
Default Re: Ruby on Rails Support

I am about to lose my mind...

I have followed the more recent steps (posted since June of this year) and still can't get a RoR app running on my site.

Here are the steps I have taken so far:
1.) Install rails app into ~/public_html/blueteamdev via SSH
2.) Edit .htaccess in blueteamdev/public to include the info found in this post: http://forums.hostgator.com/showpost...&postcount=178
3.) Created a symlink named "btd" that links to ~/public_html/blueteamdev/public
4.) Added the following to environment.rb:
Code:
ENV['RAILS_ENV'] ||= 'production'
ENV['RAILS_RELATIVE_URL_ROOT']="~/public_html/blueteamdev"
I have also tried
ENV['RAILS_RELATIVE_URL_ROOT']="~/public_html/blueteamdev/public"
I have also tried
ENV['RAILS_RELATIVE_URL_ROOT']="/btd"
When I go to www.mydomain.com/btd, I am taken to the generic RoR Welcome screen. The same occurs if I go to www.mydomain.com/blueteamdev/public. Great, so I know the symlink is working.

Go back to SSH and create a dummy controller/model/view via: script/generate scaffold test name:string number:integer

Check the directory structure and sure enough, the controller, model, and view are created correctly and "map.resources :tests" is added to routes.rb

So I go back to the web browser and try: www.mydomain.com/btd/tests and I get "No route matches "/btd/tests" with {:method=>:get}". I try www.mydomain.com/btd/tests/index and get the same thing. BUT, if I go to www.mydomain.com/blueteamdev/tests, I get a generic HostGator 404 screen.

So where am I missing something? I haven't even tried to upload my locally developed app to the site, I can only imagine how many gremlins that will uncover.

Any help to get a simple server-created app running!? (I am on gator361 if that helps in any way)
Reply With Quote
  #196  
Old Yesterday, 03:45 PM
AirplaneGuy AirplaneGuy is offline
Hatchling Croc
 
Join Date: Nov 2009
Posts: 2
Default Re: Ruby on Rails Support

Quote:
Originally Posted by AirplaneGuy View Post
I am about to lose my mind...

I have followed the more recent steps (posted since June of this year) and still can't get a RoR app running on my site.

Here are the steps I have taken so far:
1.) Install rails app into ~/public_html/blueteamdev via SSH
2.) Edit .htaccess in blueteamdev/public to include the info found in this post: http://forums.hostgator.com/showpost...&postcount=178
3.) Created a symlink named "btd" that links to ~/public_html/blueteamdev/public
4.) Added the following to environment.rb:
Code:
ENV['RAILS_ENV'] ||= 'production'
ENV['RAILS_RELATIVE_URL_ROOT']="~/public_html/blueteamdev"
I have also tried
ENV['RAILS_RELATIVE_URL_ROOT']="~/public_html/blueteamdev/public"
I have also tried
ENV['RAILS_RELATIVE_URL_ROOT']="/btd"
When I go to www.mydomain.com/btd, I am taken to the generic RoR Welcome screen. The same occurs if I go to www.mydomain.com/blueteamdev/public. Great, so I know the symlink is working.

Go back to SSH and create a dummy controller/model/view via: script/generate scaffold test name:string number:integer

Check the directory structure and sure enough, the controller, model, and view are created correctly and "map.resources :tests" is added to routes.rb

So I go back to the web browser and try: www.mydomain.com/btd/tests and I get "No route matches "/btd/tests" with {:method=>:get}". I try www.mydomain.com/btd/tests/index and get the same thing. BUT, if I go to www.mydomain.com/blueteamdev/tests, I get a generic HostGator 404 screen.

So where am I missing something? I haven't even tried to upload my locally developed app to the site, I can only imagine how many gremlins that will uncover.

Any help to get a simple server-created app running!? (I am on gator361 if that helps in any way)
I may have found the solution to my own question. It appears that having ENV['RAILS_ENV'] ||= 'production' in the environment.rb file was hosing things up for some reason. I even tried changing it from 'production' to 'development' and it still would work right. I removed the line entirely and voila!
Reply With Quote
Reply

Bookmarks

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Forum Jump

All times are GMT -6. The time now is 08:09 PM.

 
Forum SEO by Zoints