View Full Version : New Ruby On Rails knowledge base article Added
rando
06-20-2006, 01:52 PM
I've finally gotten the time to update the bluehost ruby on rails knowledge base article. This is much more comprehensive than the old version and holds your hand the whole way through, even if you're not a programmer (though it does help to be a programmer if you would like to write web applications using ruby on rails :) ). Using this tutorial you should be able to set up a basic ruby on rails application, and assuming you're a decent programmer, you'll be well on your way to developing a more full-featured ruby on rails application.
http://helpdesk.bluehost.com/kb/index.php?x=&mod_id=2&root=8&id=232
areidmtm
06-20-2006, 02:17 PM
I couldn't get that URL to work, but this one does work!
http://helpdesk.bluehost.com/kb/index.php?x=&mod_id=2&root=8&id=232
rando
06-20-2006, 02:18 PM
I couldn't get that URL to work, but this one does work!
http://helpdesk.bluehost.com/kb/index.php?x=&mod_id=2&root=8&id=232
Oh, right. I guess I shouldn't have used the internal url :)
My url has been fixed.
dvessel
06-20-2006, 03:52 PM
Cool, I'm going to have to look into it. If anyone on OSX needs a test environment for this check out Locomotive (http://arstechnica.com/journals/apple.ars/2005/10/4/1420). -arstechnica link
I'll find out soon enough how well it treats non-programmers. :p
Thanks for the writing it.
sesstreets
06-20-2006, 09:52 PM
I dont know that much about RoR but Im glad that you updated it for those who care :)
Dallas Crilley
06-20-2006, 10:45 PM
Very nice work Rando, I've been interested in Ruby/Ruby on Rails recently; in fact one of my main selling points with BH was that they supported Ruby. I'll be sure to look at your tutorial after I finish with the other stack of languages that I've been putting off learning. ;)
areidmtm
06-20-2006, 10:46 PM
I went through it and found it very helpful and easy. Although I don't think that I'll ever use ROR, becasue I'm happy with PHP...but maybe in the near future I'll make the switch.
sesstreets
06-21-2006, 11:59 PM
People say that RoR is the future...but Im not so sure about that. from what I hear its not exactly the easiest to setup. Ill stick with php+mysql anyday
eddye
06-22-2006, 02:14 AM
I am having problems to make my RoR app to work on BlueHost. First time I tried to just upload a complex application. It isn't working at all. I thought that might be the missing gems (very few gems are installed on BlueHost). Then I tried with another app that uses only standard gems (no extra plugins). It doesn't work. Then I tried the tutorial step by step to see if rails is working. I am unable to use ./script/generate to generate the scafold for my DB tables.
:confused: :confused: :confused:
I would appreciate any help. I took the BlueHost hosting services only for RoR support. I used to do with PHP (more than 5 years), but RoR changed my live, I think that I will never touch PHP again, but I really need a reliable RoR hosting for that.
Thank you for your time,
eddye
The tutorial is a good start, but...
FastCGI?
Ruby Gems?
Ajax support?
Symbolic links?
All of the RoR books and generic tutorials seem to be based on the assumption that you both own and know how to administer your host computer, web server, and database. This is most often not the case for we devoted BH subscribers :)
I would suggest a BH RoR Wiki that would allow both the support team and subscribers to contribute their "gems" of knowlege gained from facing and overcoming the obsticals imposed by using BH shared servers.
just my 2 cents
joe
rando
06-22-2006, 08:57 AM
People say that RoR is the future...but Im not so sure about that. from what I hear its not exactly the easiest to setup. Ill stick with php+mysql anyday
It's not about setup ease at all. The point of ruby on rails is having an advanced MVC application framework which makes it easy for an experienced developer to quickly and rapidly write an application without having to deal with a lot of the tedious work that's normally associated with developing a web application.
All of the RoR books and generic tutorials seem to be based on the assumption that you both own and know how to administer your host computer, web server, and database. This is most often not the case for we devoted BH subscribers
It's not the RoR books and tutorials that make this assumption, it's ruby on rails itself. It was never designed for a shared hosting environment, as the design was for applications that are big enough to require a dedicated server (or even scale to multiple dedicated servers).
Getting it to work in a shared server environment is, therefore, a very complicated task.
Unfortunately, I've done pretty much all the work I'll be able to do for ruby on rails at bluehost, as tomorrow's my last day here. I'm not sure who will be taking over on the RoR front, but all of the rest of the technical staff are very intelligent guys and I'm sure that ruby support won't suffer without me.
:eek:
<snip>
Unfortunately, I've done pretty much all the work I'll be able to do for ruby on rails at bluehost, as tomorrow's my last day here. I'm not sure who will be taking over on the RoR front, but all of the rest of the technical staff are very intelligent guys and I'm sure that ruby support won't suffer without me.
You will be missed! Your participation and responsiveness in this forum have been very much appreciated.
joe
ianpurton
07-26-2006, 09:13 AM
I was able to deploy my ruby on rails app succesfully to Bluehost.
Deployment went well, I had a few issues when I tried to upload my generated code and I had to back track and use the rails project code generated on my hosting account.
site is
http://www.ploud.com
jholland
08-09-2006, 05:17 AM
How can I get my rails application to run in the root directory? This help article only describes running it in a subdomain.
mansfiem
08-09-2006, 08:02 PM
I am having the same problem too with creating a RoR app that can be anywhere other than a subdomain.
ianpurton
08-10-2006, 01:01 AM
You could try using .htaccess to redirect traffic from your root domain to your subdomain.
rando
08-10-2006, 04:56 AM
How can I get my rails application to run in the root directory? This help article only describes running it in a subdomain.
You can do this by mving your ~/public_html to somewhere else (or just deleting it) and creating a new symlink from railsapp/public to ~/public_html/
mansfiem
08-10-2006, 09:15 PM
Rando,
What's a symlink? I think I know what you want me to do, but want to double check before I actually do it.
And will be there a BlueHost tutorial on using Capistrano or SVN X?
Thanks,
Matthew
jholland
08-11-2006, 05:10 AM
You can do this by mving your ~/public_html to somewhere else (or just deleting it) and creating a new symlink from railsapp/public to ~/public_html/
Ok. I didn't know if I could delete /public_html
chisel
08-14-2006, 06:06 PM
Hello,
I'm new to Bluehost but I've been working on RoR for some time. I'm having a bit of trouble getting RoR to work on Bluehost.
I've followed the tutorials to setup and sym-linked my RoR directories accordingly, yet without any success.
The symlink works but it seems the cgi dispatch isn't working quite right. For example, the site does not automatically display the "index.html" file until I manually punch it in, ie. http://xx.xx.xx.xx/~username/index.html. It won't work with just http://xx.xx.xx.xx/~username/. My domain has yet to be transfered so I'm stuck with this address for awhile.
I'm getting 404 error and sometimes 403 errors with this.
I'm thinking my problems are due to dns configurations since my domain hasn't yet been transfered. However, I'm doubtful of this is the issue.
You guys have any suggestions or thoughts?
wmonou
09-19-2006, 01:02 AM
hai im very new and really need your help for this...
it seem RoR dosnt work properly on bluehost (maybe...)
okay i can access the public folder with the DNS, but when i am accessing to my controller like www.xyz.com/news/, theyre looking for some index in folder news in www.xyz.com... (ex: public/news/index.html)
we already know that news in behind www.xyz.com isnt a folder, doesnt it? but its controller, right...
So anyone can help please....
techgy
09-21-2006, 12:27 PM
If I'm reading your question right, you're asking if all folders are in the public folder and the answer, I believe would be yes. Your site would begin with an index file in the public folder and would be linked from there on throughout your sites navigation structure.
Or did I mis-understand your question??
:rolleyes:
aceofspades
09-21-2006, 12:45 PM
I followed the bluehost tutorial to the tee but when I tried to make the first subdomain a ruby subdomain it said In not a -bash command. Im confused now.
wmonou
09-21-2006, 06:45 PM
If I'm reading your question right, you're asking if all folders are in the public folder and the answer, I believe would be yes. Your site would begin with an index file in the public folder and would be linked from there on throughout your sites navigation structure.
Or did I mis-understand your question??
:rolleyes:
thanks for the anwser techgy..
but it doesnt like what i mean about it.. maybe this is because my english completely bad..normaly all site is working with that way.. but in MVC framework site like RoR, it wont be like that.
in document root directories, RoR can have nothing... and then the real content is in app/controller directories.
so when i trying accessing www.xyz.com/news/ on MVC site, it doesnt mean i want to access news directories on www.xyz.com but it means i want to access news controller form www.xyz.com, this is what actually happen with with my problem.
chisel
09-23-2006, 01:38 PM
Okay, from what I understand, this is how Rails work.
Rails consists of MVC, in the app window.
The structure is like this
<code>
app
-controllers
- views
-models
..
..
public
- javascript
- stylesheet
- images
...
</code>
I'm sure you understand that structure by looking at a rails app. Anyhow, the way rails work it is it looks at the index.rhtml or index.html file under {Rails_Root}/public.
If the index.html or index.rhtml is not there, then it'll give an error. However, you can change the rails routing procedure so that it'll use your rails controller as the starting page.
You can do this by going to config/routes.rb and add this line
<code>
map.connect '', :controller => "your_controller"
</code>
This means you no longer have to do www.mysite.com/your_controller to access that particular controller. You can do www.mysite.com and it'll automatically look for the index.rhtml page or any other page in "your_controller".
Everything else should work as it should.
wmonou
09-25-2006, 05:51 PM
Okay, from what I understand, this is how Rails work.
Rails consists of MVC, in the app window.
The structure is like this
<code>
app
-controllers
- views
-models
..
..
public
- javascript
- stylesheet
- images
...
</code>
I'm sure you understand that structure by looking at a rails app. Anyhow, the way rails work it is it looks at the index.rhtml or index.html file under {Rails_Root}/public.
If the index.html or index.rhtml is not there, then it'll give an error. However, you can change the rails routing procedure so that it'll use your rails controller as the starting page.
You can do this by going to config/routes.rb and add this line
<code>
map.connect '', :controller => "your_controller"
</code>
This means you no longer have to do www.mysite.com/your_controller to access that particular controller. You can do www.mysite.com and it'll automatically look for the index.rhtml page or any other page in "your_controller".
Everything else should work as it should.
thanks for reply chise...
I know that... my ruby is goes well on my local machine with apache too...
map.connect '', :controller => "home",
I understand this thing, what i don't understand is why the server cant found my action on my controller..
maybe it something wrong with mod_ruby on apache module on this bluehost...
it is okay with cakephp which is also MVC framework, but not with RoR
I'm sure there is no index file in public anymore... and I'm sure that i have def index on my home controller.
dhaveconfig
09-27-2006, 01:47 PM
So are we supposed to install gems into some other directory and then point our rails apps at that? I get told that I don't have permission to install into the default location, and I can't seem to work out how to sudo/su, or whether we're even allowed to do that...
dhaveconfig
09-27-2006, 04:06 PM
So I worked out that I can install gems locally, and either use a combination of mine plus the bluehost ones, or just mine, it's just a matter of setting GEM_PATH appropriately in environment.rb
I can post instructions if anyone wants, but all the documentation on doing this is out there already. Be nice to add it to the article though.
rando
10-05-2006, 12:26 AM
So are we supposed to install gems into some other directory and then point our rails apps at that? I get told that I don't have permission to install into the default location, and I can't seem to work out how to sudo/su, or whether we're even allowed to do that...
Basically, since suexec stupidly strips the environment, the only thing you can do is have a CGI wrapper that sets the gem_path environment variable
dhaveconfig
10-05-2006, 12:42 AM
Ahah. You've just explained why I've been having problems setting various environment variables with another cgi...
but anyway... you can do what I described above, you just need to install gems locally and then you can edit your environment.rb file so that it sets the environment variables appropriately.
Won't work for ruby cgi stuff as I mentioned, but does work for the standard action/controller/id sort of stuff.
Now if only I could set RUBYLIB in a cgi context...
dlcideas
10-24-2006, 04:11 AM
Hello,
I'm a student from Switzerland I would like to use ROR, but at moment I haven't access to SSH on my account.
I checked the support site but to say true, that's great to give a number to call... But that's better to give a number that all poeple can call !
I don't have any scan to provide my idendity or driving card so at moment I'm a little bit stuck.
I hope there will be a easier solution soon, because I took my 1year host on bluehost only because of ROR support.
Case you can do something now, I wanted a ssh the same name account/pass that I already use to bluehost pannel.
Thanks for any help you can provide.
sebounet
10-27-2006, 08:12 AM
I do not understand why i'm not getting able to install my first application exactly the same way as the tutorial :
eyleacom@eylea.com [~/rails]# ls
./ ../
eyleacom@eylea.com [~/rails]# rails first
/usr/lib64/site_ruby/1.8/rubygems.rb:194:in `report_activate_error': Could not find RubyGem rails (> 0) (Gem::LoadError)
from /usr/lib64/site_ruby/1.8/rubygems.rb:136:in `activate'
from /usr/lib64/site_ruby/1.8/rubygems.rb:37:in `require_gem_with_options'
from /usr/lib64/site_ruby/1.8/rubygems.rb:31:in `require_gem'
from /usr/bin/rails:17
eyleacom@eylea.com [~/rails]#
Any ideas?
Dude thats to bad to fail at this point :(
dlcideas
10-27-2006, 06:03 PM
It seems gem is not correctly installed.
Did you try to reinstall it ?
sebounet
10-28-2006, 12:19 AM
How can i reinstall it since i'm not root? :confused:
free2001
10-28-2006, 12:40 AM
Hello,
I'm a student from Switzerland I would like to use ROR, but at moment I haven't access to SSH on my account.
I checked the support site but to say true, that's great to give a number to call... But that's better to give a number that all poeple can call !
I don't have any scan to provide my idendity or driving card so at moment I'm a little bit stuck.
I hope there will be a easier solution soon, because I took my 1year host on bluehost only because of ROR support.
Case you can do something now, I wanted a ssh the same name account/pass that I already use to bluehost pannel.
Thanks for any help you can provide.
theres a non 1888 (toll free) number you can call its long distance but you can call it from any place. Get an IP phone or something. I use Vonage its like pennys a min to call any place in the world.
hendo
12-06-2006, 08:54 PM
Rando:
Can you suggest a good book on Ruby on Rails?
schwecheimer
12-13-2006, 09:09 AM
For some reason my application is not working at all. I have setup my symlink perfectly. But when I am trying to access my controllers all I get is a 404 error. I can type in the index.html and get that page. But any controllers are not coming up. If this has to do with gems while someone tell me how to install new gems into my application...
schwecheimer
12-27-2006, 02:36 PM
has anyone had problems with getting the request.post? conditional statement working?
For some reason my application is not working at all. I have setup my symlink perfectly. But when I am trying to access my controllers all I get is a 404 error. I can type in the index.html and get that page. But any controllers are not coming up.
Same here, the start page comes up, I can also run the rake migrate tasks, but no controllers are picking anything up, I always get 404.
Any hints?
Regards,
Peter
octoberdan
01-20-2007, 11:20 AM
I was having some problems moving my app from my server to the BlueHost server, but I solved them by copying the dispatch files from the public folder of a rails generated test app on BlueHost to the public folder of my project. Hope that tid bit helped! Good luck.
bondibox
02-08-2007, 07:32 AM
I am satisfied with my RoR setup at Bluehost so I'll share some points which may be obvious to some but common knowledge not yet absorbed by the newbs.
For this example, my domain will be raildomain.com and the root of my account is /home/raildoma
I created a working directory for all my rails apps at
/home/raildoma/railsapps
and my main rails application is named blog, it's also the name of a subdomain I created.
/home/raildoma/railsapps/blog/public/ is the path of the symlink from
/home/raildoma/public_html/blog
The file /home/raildoma/public_html/.htaccess looks like this:
RewriteEngine on
RewriteCond %{HTTP_HOST} ^(www.)?raildomain.com$
RewriteCond %{REQUEST_URI} !^/blog/
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ /blog/$1
RewriteCond %{HTTP_HOST} ^(www.)?raildomain.com$
RewriteRule ^(/)?$ blog/index.html [L]
Now my subdomain has been masked, and
http://www.raildomain.com pulls up the content from
http://blog.raildomain.com, and is the same as
http://www.raildomain.com/blog
My environment.rb file in ~/railsapps/blog/config/ has the line:
ENV['RAILS_ENV'] ||= 'production'
dispatch.cgi starts with the line:
#!/usr/bin/ruby
and any gems I used were installed with steps I already posted at http://www.bluehostforum.com/showthread.php?t=1944, a Mephisto-specific thread.
CosmicVoyager
03-04-2007, 08:41 PM
This is great, but it assumes the user is creating a Ruby app from scratch. What I'd like to do (and have tried several times without success) is to install an established Ruby app, like Tracks (http://www.rousette.org.uk/projects/). There are instructions for installing it on Dreamhost, but it didn't work for me. Has anyone gotten Tracks running on Bluehost, and can you post simple instructions on how to do so?
On a related note, why does every Ruby tutorial start with "make a subdomain"? Can't you just put it in a subdirectory and run it through http://www.mydomain.com/rubyapp, like PHP apps can?
Thanks for any help!
clovisthefrog
03-14-2007, 06:21 PM
Is it possible to set up a similar wiki for installing Django? I think a lot of us are trying to install Django on our accounts using the instructions on http://www.bluehostforum.com/showthread.php?t=715 with varying results.
mspaul
03-19-2007, 04:17 PM
My RoR based application was working fine and then, bluehast upgraded rails to 1.2.1 and my application is down now:
I get HTTP 500 Internal server error.
Called tech support and they asked me to change environment.rb file to look for 1.2.1 version. -- Did that; still not working. Getting the same error.
Anybody having any ideas why am I getting this error :( .
-Thanks
eL-h0Li0
03-20-2007, 04:28 AM
My RoR based application was working fine and then, bluehast upgraded rails to 1.2.1 and my application is down now:
I get HTTP 500 Internal server error.
Called tech support and they asked me to change environment.rb file to look for 1.2.1 version. -- Did that; still not working. Getting the same error.
Anybody having any ideas why am I getting this error :( .
-Thanks
After the upgrade I had success with just changing the RAILS_GEM_VERSION variable from '1.1.6' to '1.2.3'
However, although I´m not sure, you could be having troubles with your dispatchers (found in /yourrailsapp/public/) or possibly something is wrong with the rewrite rules in your .htaccess file (also found in /yourrailsapp/public).
You could try to look for instructinons on how these files should be configured and then compare it to your existing configurations.
mspaul
03-20-2007, 03:55 PM
After the upgrade I had success with just changing the RAILS_GEM_VERSION variable from '1.1.6' to '1.2.3'
However, although I´m not sure, you could be having troubles with your dispatchers (found in /yourrailsapp/public/) or possibly something is wrong with the rewrite rules in your .htaccess file (also found in /yourrailsapp/public).
You could try to look for instructinons on how these files should be configured and then compare it to your existing configurations.
You are right, 1.2.3 worked. - Thanks
I don't know why Customer support asked me to change it to 1.2.1 :confused:
schwecheimer
03-21-2007, 11:51 AM
After the upgrade I had success with just changing the RAILS_GEM_VERSION variable from '1.1.6' to '1.2.3'
However, although I´m not sure, you could be having troubles with your dispatchers (found in /yourrailsapp/public/) or possibly something is wrong with the rewrite rules in your .htaccess file (also found in /yourrailsapp/public).
You could try to look for instructinons on how these files should be configured and then compare it to your existing configurations.
I changed my version to 1.2.3 but for some reason I am still getting an application failed to start properly error. anyone know what else I can look into? This application was working fine before the update.
It probably depends on which box you're on. My sites just broke last night (so I am assuming the upgrade was done then), but it looks like many of you were upgraded last week. Log in to the shell and do a "gem list" command. The highest rails version listed is what you need to have for your RAILS_GEM_VERSION variable in your environment.rb file. As far as why you were told 1.2.1, there was a 1.2.1 upgrade just a week or so ago. I get the sense that whoever you talked to was either unaware of the 1.2.3 upgrade or too lazy to look at your actual box.
I'm personally a little irritated that we didn't get notified about the upgrades prior to them happening. These upgrades will break any and every default rails installation. Twice in the past few weeks I have woken up to find two of my sites completely down because of them. This time I knew what to do, but these can be costly upgrades for sites doing advertising (as we do) who end up paying for clicks to an error page, or sites who count on being able to provide a reliable service. Would it be so hard to post list of planned upgrades for the next week or so that we can be prepared? Especially in cases where there is a large probability of it taking down sites.
I understand that in emergencies this can't happen, but I don't get the sense these were emergency upgrades.
paranoid87
06-14-2007, 08:53 AM
dunno why..but i am also getting an application error!
--------------------------------------------------------------------------------
Electricity suppliers (http://www.you-switch.org/electricity-suppliers)
Cheapest broadband (http://www.broardband.net/cheapest_broadband.php)
ruybalid
07-22-2007, 09:27 PM
Hello,
I'm new to Bluehost but I've been working on RoR for some time. I'm having a bit of trouble getting RoR to work on Bluehost.
I've followed the tutorials to setup and sym-linked my RoR directories accordingly, yet without any success.
The symlink works but it seems the cgi dispatch isn't working quite right. For example, the site does not automatically display the "index.html" file until I manually punch it in, ie. http://xx.xx.xx.xx/~username/index.html. It won't work with just http://xx.xx.xx.xx/~username/. My domain has yet to be transfered so I'm stuck with this address for awhile.
I'm getting 404 error and sometimes 403 errors with this.
I'm thinking my problems are due to dns configurations since my domain hasn't yet been transfered. However, I'm doubtful of this is the issue.
You guys have any suggestions or thoughts?
I seem to be having the same issue. My domain has not transferred, so I am accessing my RoR app like this as well:
http://xx.xx.xx.xx/~username/.
I followed exactly the tutorial but for some reason apache is looking for my dispatch.cgi file in the wrong place. The error logs show:
[Sun Jul 22 22:50:19 2007] [error] [client 24.***.***.127] File does not exist: /usr/local/apache/htdocs/home/ruybalid/public_html/first/dispatch.cgi
And I can't see that /usr/local even exists. I seems like /usr/local/apache/htdocs should just be removed...
Anybody have any ideas?
Burninglegion
08-03-2007, 05:42 AM
I am satisfied with my RoR setup at Bluehost so I'll share some points which may be obvious to some but common knowledge not yet absorbed by the newbs.
For this example, my domain will be raildomain.com and the root of my account is /home/raildoma
I created a working directory for all my rails apps at
/home/raildoma/railsapps
and my main rails application is named blog, it's also the name of a subdomain I created.
/home/raildoma/railsapps/blog/public/ is the path of the symlink from
/home/raildoma/public_html/blog
The file /home/raildoma/public_html/.htaccess looks like this:
RewriteEngine on
RewriteCond %{HTTP_HOST} ^(www.)?raildomain.com$
RewriteCond %{REQUEST_URI} !^/blog/
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ /blog/$1
RewriteCond %{HTTP_HOST} ^(www.)?raildomain.com$
RewriteRule ^(/)?$ blog/index.html [L]
Now my subdomain has been masked, and
http://www.raildomain.com pulls up the content from
http://blog.raildomain.com, and is the same as
http://www.raildomain.com/blog
My environment.rb file in ~/railsapps/blog/config/ has the line:
ENV['RAILS_ENV'] ||= 'production'
dispatch.cgi starts with the line:
#!/usr/bin/ruby
and any gems I used were installed with steps I already posted at http://www.bluehostforum.com/showthread.php?t=1944, a Mephisto-specific thread.
I think this is quite an important thing to know for all RoR users who wan to start their page. Is it possible to include this in the RoR tutorial?
jgrevich
08-30-2007, 10:49 AM
I am satisfied with my RoR setup at Bluehost so I'll share some points which may be obvious to some but common knowledge not yet absorbed by the newbs.
For this example, my domain will be raildomain.com and the root of my account is /home/raildoma
I created a working directory for all my rails apps at
/home/raildoma/railsapps
and my main rails application is named blog, it's also the name of a subdomain I created.
/home/raildoma/railsapps/blog/public/ is the path of the symlink from
/home/raildoma/public_html/blog
The file /home/raildoma/public_html/.htaccess looks like this:
RewriteEngine on
RewriteCond %{HTTP_HOST} ^(www.)?raildomain.com$
RewriteCond %{REQUEST_URI} !^/blog/
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ /blog/$1
RewriteCond %{HTTP_HOST} ^(www.)?raildomain.com$
RewriteRule ^(/)?$ blog/index.html [L]
Now my subdomain has been masked, and
http://www.raildomain.com pulls up the content from
http://blog.raildomain.com, and is the same as
http://www.raildomain.com/blog
Thanks for the pointers, but I still haven't figured out the correct solution for my setup needs. Is there any guide on how to setup multiple rails apps on bluehost?
I have 3 domains and 3 apps for each domain. Currently www.app1.com points to the public_html directory which is a symlink to my ~/rails/app1/public/.
I would like to have the following structure:
http://www.app1.com/ -> ~/public_html/app1 -> ~/rails/app1/public
http://www.app2.com/ -> ~/public_html/app2 -> ~/rails/app2/public
http://www.app3.com/ -> ~/public_html/app3 -> ~/rails/app3/public
Could anyone help to point me in the right direction on this?
Thanks in advance,
justin
comopasta
12-12-2007, 05:35 AM
Thanks for the pointers, but I still haven't figured out the correct solution for my setup needs. Is there any guide on how to setup multiple rails apps on bluehost?
I have 3 domains and 3 apps for each domain. Currently www.app1.com points to the public_html directory which is a symlink to my ~/rails/app1/public/.
I would like to have the following structure:
http://www.app1.com/ -> ~/public_html/app1 -> ~/rails/app1/public
http://www.app2.com/ -> ~/public_html/app2 -> ~/rails/app2/public
http://www.app3.com/ -> ~/public_html/app3 -> ~/rails/app3/public
Could anyone help to point me in the right direction on this?
Thanks in advance,
justin
Hi jgrevich. Have you managed to get the three rails apps in BH?
Thanks
This is great, but it assumes the user is creating a Ruby app from scratch. What I'd like to do (and have tried several times without success) is to install an established Ruby app, like Tracks (http://www.rousette.org.uk/projects/). There are instructions for installing it on Dreamhost, but it didn't work for me. Has anyone gotten Tracks running on Bluehost, and can you post simple instructions on how to do so?
On a related note, why does every Ruby tutorial start with "make a subdomain"? Can't you just put it in a subdirectory and run it through http://www.mydomain.com/rubyapp, like PHP apps can?
Thanks for any help!
The steps 1 through 4 are straight from the installation.html file that comes with Tracks. I added steps 5 & 6 because the rake chokes with setting the default values. I did a (very) little bit of research and came to the conclusion that MySql won’t let you default a datetime field. It makes so little sense that I doubt my conclusion, but it’s good enough for now? I wonder whether I’ll miss them…
1. upload everything to rails/tracks2
2. create databases & users, assign permissions
1. databases: tracks2, tracks2Dev, tracks2Test
2. user: tracks, password:tracks
3. add user to each database (give all privileges)
3. edit config/database.yml
1. uncomment the MySQL & comment the SQLite sections
2. change the database, username and passwords to match what you did in step 2
4. edit config/environment.rb
1. change “change-me” (in the SALT = “change-me”) to something else
2. I uncommented this line: ENV[’TZ’] = ‘US/Eastern’
5. edit db/migrate/001_create_tracks_db.rb
1. comment the default datetime value:
1. t.column :created, :datetime #, :default => ‘0000-01-01 00:00:00′
6. edit db/migrate/004_notes.rb
1. comment the default datetime values:
1. t.column :created_at, :datetime #, :default => ‘0000-01-01 00:00:00′
2. t.column :updated_at, :datetime #, :default => ‘0000-01-01 00:00:00′
7. cd /pathto/tracks2
8. rake db:migrate
9. chmod /pathto/tracks2/public/dispatch.*
1. set permissions to 755
10. make a subdomain tracks2.yourdomain.com
11. delete the tracks2 directory and make a symbolic link to the application
1. cd ~/public_html/
2. rm -r tracks2
3. ln -s /home/username/rails/tracks2/public tracks2
12. browse to tracks2.yourdomain.com/signup
1. sign up as the admin user (as prompted)
2. log in as the admin user (as prompted)
13. You’re in business.
I can't answer your related question about why we're always told to make a subdomain.
gesneria
01-21-2008, 12:43 PM
Hello,
I have reformatted the instructions to be more logical:
1. To begin, log into the server using SSH. You'll need a work area for your rails application. Assuming ahead of time that you may eventually want multiple applications, you should make a work directory and then cd into it. You can name it whatever you would like, but this document assumes that it is called "rails".
% mkdir ~/rails
% cd ~/rails
2. Now you may create your application. As we are just making a simple Hello World application, we'll assume that the application is named "first".
% rails first
% cd first
3. Next, we're going to set up a subdomain for this application to run on. Log into your cPanel, click on 'subdomains', then type 'first' into the first text box and click 'Add'. You've now created a new subdomain, first.yourdomain.com, which will be the new home of your ruby on rails application. Now, we're going to make your application's "public" directory be the rootdir of that subdomain with the following commands:
% cd ~/public_html/
% rm -r first
% ln -s /home/YOUR_USERNAME/rails/first/public first
4. You should now be able to go to http://first.yourdomain.com/, where you will see the Ruby on Rails welcome message. As the welcome page suggests, it is now time to set up your databases.
5. In cPanel, click on 'MySQL Databases'. The first thing you'll want to do here is add an SQL user for rails to use. You can name this whatever you'd like. We will assume you used 'rails'. cPanel prepends your username to the user name, so you should take note of the actual name created (it should be username_rails).
6. Next, we're adding a database. Name this database 'first', to match your application name. You will again notice that username_ has been prepended. Finally, we're going to link this username to the database. Select username_rails and username_first from the dropdowns and make sure the 'All' checkbox below them is checked, then click the 'Add User To DB' button.
7. Now you should repeat this step, with 'firstdev' as the database name, and linking username_rails to it.
8. Now we're going to edit the database.yml file. Open ~/rails/first/config/database.yml in your favorite editor, and modify the 'development' and 'production' sections to contain the username, password, and database that you just created.
production:
adapter: mysql
database: username_first
host: localhost
username: username_rails
password: password
development:
adapter: mysql
database: username_firstdev
host: localhost
username: username_rails
password: password
Next you should create the actual database data. From the mySQL page in cPanel, you should find a 'phpmyadmin' link. Within phpmyadmin, select the "_first" database from the dropdown on the left, then click on the "SQL" tab along the top. Paste the following into your box and click 'Go':
CREATE TABLE `people` (
`id` int(10) unsigned NOT NULL auto_increment,
`name` varchar(50) NOT NULL default '',
`street1` varchar(70) NOT NULL default '',
`street2` varchar(70) NOT NULL default '',
`city` varchar(70) NOT NULL default '',
`state` char(2) NOT NULL default '',
`zip` varchar(10) NOT NULL default '',
PRIMARY KEY (`id`),
KEY `name` (`name`)
) TYPE=MyISAM AUTO_INCREMENT=2 ;
10. Now, click on the SQL tab one more time, and run this query:
INSERT INTO `people` VALUES (1, 'Superman', '123 Somewhere', '', 'Smallville', 'KS', '123456');
11. Now repeat these two sql queries for your _firstdev database.
12. The next step is to create a controller.
% ./script/generate controller First list view new edit
After that has been created, you will create your model.
% ./script/generate model Person
Now we're going to modify two files. First, open app/views/first/view.rhtml and make it look like this:
<html>
<body>
<h1>Friends#view</h1>
<p>This page will display one friend</p>
<p>
<%= @person.name %><br />
<%= @person.street1 %><br />
<%= @person.street2 %><br />
<%= @person.city %><br />
<%= @person.state %><br />
<%= @person.zip %><br />
</p>
</body>
</html>
15. Next, open app/controllers/first_controller.rb and modify the 'view' method to look like this:
def view
@person = Person.find(1)
end
====================
So far I have gone through step 4 and when opening my location "first.gesneriads.com" get a 403 forbidden error. Any suggestions?
W Wells NYC
birdsnare
02-15-2008, 09:18 AM
Rando,
What's a symlink? I think I know what you want me to do, but want to double check before I actually do it.
And will be there a BlueHost tutorial on using Capistrano or SVN X?
Thanks,
Matthew
I don't know if bluehost offered a tutorial about Capistrano or svn, but I posted information about Capistrano in this post. (http://www.bluehostforum.com/showthread.php?p=48891#post48891)
Necron99
03-14-2008, 06:40 PM
Remember: I'm a complete noob when it comes to RoR. I've followed the tutorial to the letter. When I try and generate the controller, I get:
/home/blacklig/rails/first>./script/generate controller First list view new edit
/usr/lib/ruby/gems/1.8/gems/activerecord-2.0.2/lib/active_record/connection_adapters/abstract/connection_specification.rb:217:in `establish_connection': development database is not configured (ActiveRecord::AdapterNotSpecified)
from /usr/lib/ruby/gems/1.8/gems/activerecord-2.0.2/lib/active_record/connection_adapters/abstract/connection_specification.rb:208:in `establish_connection'
from /usr/lib/ruby/gems/1.8/gems/rails-2.0.2/lib/initializer.rb:234:in `initialize_database'
from /usr/lib/ruby/gems/1.8/gems/rails-2.0.2/lib/initializer.rb:94:in `process'
from /usr/lib/ruby/gems/1.8/gems/rails-2.0.2/lib/initializer.rb:49:in `send'
from /usr/lib/ruby/gems/1.8/gems/rails-2.0.2/lib/initializer.rb:49:in `run'
from /home/blacklig/rails/first/config/environment.rb:13
from /usr/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in `gem_original_require'
from /usr/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in `require'
from /usr/lib/ruby/gems/1.8/gems/rails-2.0.2/lib/commands/generate.rb:1
from /usr/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in `gem_original_require'
from /usr/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in `require'
from ./script/generate:3
It complains about the development database not being configured, when it is. Here is my database.yml:
production:
adapter: mysql
database: blacklig_first
host: localhost
username: blacklig_rails
password: xxxxxxxx
development:
adapter: mysql
database: blacklig_firstdev
host: localhost
username: blacklig_rails
password: xxxxxxxx
Any help would be greatly appreciated!
Update: Never mind. A Google search for the error brought me back to Bluehost's Knowledge Base:
http://helpdesk.bluehost.com/kb/index.php?x=&mod_id=2&id=438
Dave
sparkx.info
04-05-2008, 11:09 PM
I agree. I can get my RoR app running on my local PC in Netbeans environment, but can't get it running on BlueHost. I'm re-writing an existing java app to run in RoR web based.
prasadk14
05-01-2008, 09:50 AM
Hi,
How to install rfacebook gem for my ruby appilcation ..
I created a ruby application and uploaded rfacebook plugin to the application's vendor/plugins folder and rfacebook gem to ruby/gems/ folder, and configured facebook.yml accordingly . But, I'm not able to start/run the application.. If I remove the facebook plugin from vendor/plugins, I can start the application...
How can I make it done?
Thanks
-Prasad.
terri
05-09-2008, 12:49 AM
Thanks for the pointers, but I still haven't figured out the correct solution for my setup needs. Is there any guide on how to setup multiple rails apps on bluehost?
I have 3 domains and 3 apps for each domain. Currently www.app1.com points to the public_html directory which is a symlink to my ~/rails/app1/public/.
I would like to have the following structure:
http://www.app1.com/ -> ~/public_html/app1 -> ~/rails/app1/public
http://www.app2.com/ -> ~/public_html/app2 -> ~/rails/app2/public
http://www.app3.com/ -> ~/public_html/app3 -> ~/rails/app3/public
Could anyone help to point me in the right direction on this?
Thanks in advance,
justin
Hi Justin,
Yes, you can have 3 rails apps (or more!) running on BlueHost, but not with the URL structure you mentioned. The URLs you list above are three different hosts (app1, app2, and app3). Think of it this way: what you've listed above is:
http://www.amazon.com
http://www.nyt.com
http://www.abcnews.com
I assume you only have one account on BlueHost, which means you have only one host: http://www.justin.com for example.
The way you set up your three Rails apps would be:
http://app1.justin.com or http://www.justin.com/app1 -> ~/public_html/app1 -> ~/rails/app1/public
http://app2.justin.com or http://www.justin.com/app2 -> ~/public_html/app2 -> ~/rails/app2/public
http://app3.justin.com or http://www.justin.com/app3 -> ~/public_html/app3 -> ~/rails/app3/public
I hope this helps.
Terri
terri
05-09-2008, 12:53 AM
Hi,
How to install rfacebook gem for my ruby appilcation ..
I created a ruby application and uploaded rfacebook plugin to the application's vendor/plugins folder and rfacebook gem to ruby/gems/ folder, and configured facebook.yml accordingly . But, I'm not able to start/run the application.. If I remove the facebook plugin from vendor/plugins, I can start the application...
How can I make it done?
Thanks
-Prasad.
Hi Prasad,
We're having the same problems, but with the ferret gem and the acts_as_ferret plugin. We have the same symptoms that you have: Not able to start/run the application with the plugin in the directory, can run the application after removing the plugin. See additional notes and questions at http://bluehostforums.com/showthread.php?p=53899
My hunch is that it has to do with the GEM_PATH, but I'm not sure. Let me know if you solve it.
Thanks,
Terri
comopasta
06-19-2008, 03:09 AM
Hi Justin,
Yes, you can have 3 rails apps (or more!) running on BlueHost, but not with the URL structure you mentioned. The URLs you list above are three different hosts (app1, app2, and app3). Think of it this way: what you've listed above is:
http://www.amazon.com
http://www.nyt.com
http://www.abcnews.com
I assume you only have one account on BlueHost, which means you have only one host: http://www.justin.com for example.
The way you set up your three Rails apps would be:
http://app1.justin.com or http://www.justin.com/app1 -> ~/public_html/app1 -> ~/rails/app1/public
http://app2.justin.com or http://www.justin.com/app2 -> ~/public_html/app2 -> ~/rails/app2/public
http://app3.justin.com or http://www.justin.com/app3 -> ~/public_html/app3 -> ~/rails/app3/public
I hope this helps.
Terri
In my case I have a domain up and running (non rails) and I'm now testing a rails app but I'm using subdomain. That is not what I want but I'm just testing.
Justin has spent some money purchasing those domains. But the solution you propose is using subdomains on one of the purchased domains. So two domains are wasted.
As I understand Justin would like to use the three domains.
Also BH claims unlimited domain hosting.
Any other alternatives to get this working? This will hit me as well at some point.
Thanks
terri
06-23-2008, 10:53 PM
Hi Comopasta,
If BlueHost supports one account with multiple domains (which you say it does) then you could have a different rails app for each domain, if you desired.
Then the way you set up your three Rails apps would be:
http://www.domain1.com or http://www.justin.com/app1 -> ~/public_html/app1 -> ~/rails/app1/public
http://www.domain2.com or http://www.justin.com/app2 -> ~/public_html/app2 -> ~/rails/app2/public
http://www.domain3.com or http://www.justin.com/app3 -> ~/public_html/app3 -> ~/rails/app3/public
You're still using a subdomain (the rails app itself is the subdomain which points to the public_html directory of the app) but a different domain for each subdomain rails app. The key is to set these up through the BlueHost cPanel subdomain menu.
Hope this helps.
Terri
awinter
08-05-2008, 04:02 PM
I followed the tutorial step by step and it does not work. All I'm getting is a 404 code...
I get something - the usual Ruby welcome page - when I log on to first.mydomainname.com, but a 404 when I try http://first.mydomainname.com/first/view
Help! Please!
awaisuk
09-09-2008, 11:19 PM
I've finally gotten the time to update the bluehost ruby on rails knowledge base article. This is much more comprehensive than the old version and holds your hand the whole way through, even if you're not a programmer (though it does help to be a programmer if you would like to write web applications using ruby on rails :) ). Using this tutorial you should be able to set up a basic ruby on rails application, and assuming you're a decent programmer, you'll be well on your way to developing a more full-featured ruby on rails application.
http://l1p.info/img1.jpg
http://helpdesk.bluehost.com/kb/index.php?x=&mod_id=2&root=8&id=232
It has been working perfectly for me, just follow the tutorial and be sure to read every instructions carefully.. if you make a mistake redo the steps and it will work for you eventually.
davidpots
09-19-2008, 11:35 AM
I have been having the same problem as many of the posters above -- first.mydomain.com/first/view has been returning 404 error after following the Bluehost tutorial here (http://helpdesk.bluehost.com/kb/index.php?x=&mod_id=2&root=8&id=232).
Finally, I found a solution having to do with the .htaccess file (http://helpdesk.bluehost.com/kb/index.php?x=&mod_id=2&id=562) -- check it out here: http://helpdesk.bluehost.com/kb/index.php?x=&mod_id=2&id=562
Very frustrating that this isn't linked from the initial RoR Setup Guide that Bluehost has, as many users (like me) would probably have benefited from it.
iwatts
11-19-2008, 05:55 PM
I have been having the same problem as many of the posters above -- first.mydomain.com/first/view has been returning 404 error after following the Bluehost tutorial here (http://helpdesk.bluehost.com/kb/index.php?x=&mod_id=2&root=8&id=232).
Finally, I found a solution having to do with the .htaccess file (http://helpdesk.bluehost.com/kb/index.php?x=&mod_id=2&id=562) -- check it out here: http://helpdesk.bluehost.com/kb/index.php?x=&mod_id=2&id=562
Very frustrating that this isn't linked from the initial RoR Setup Guide that Bluehost has, as many users (like me) would probably have benefited from it.
Where do I put this /htaccess file? If I put one in the way the helpdesk article suggested into my base public_html folder, a normal php site of mine returned a "rails failed to execute" error....
Thanks
Powered by vBulletin® Version 4.2.0 Copyright © 2013 vBulletin Solutions, Inc. All rights reserved.