On Sep 2, 2012, at 1:50 PM, Bruce Whealton wrote:

> I'll comment below.
> 
> On Sep 2, 2012, at 12:53 PM, Bruce Whealton wrote:
> 
>> Bill,
>>        First, I really appreciate your help.  At the risk of sounding naïve, 
>> in response to Dheeraj’s post that  “You need to add it to the gemfile and 
>> run the bundle command.”  How do I do that?  I guess this is where I need to 
>> be more specific about where I left off.  Ok, the tutorial that I mentioned 
>> here: 
>> http://blog.sudobits.com/2012/05/02/how-to-install-ruby-on-rails-in-ubuntu-12-04-lts/
>> uses the Webrick server.  For some reason, when I started that server and 
>> then tried to view the page using port 3000, it did not connect.
> 
> Were you trying to connect from within your virtualbox environment, or from 
> the host OS? Try looking at your Webrick-hosted sites from the same OS that 
> you launched them under -- that's the normal use-case for those sorts of 
> self-hosted apps. It's meant to be a window into your dev site, just a 
> quick-and-dirty hack to get you to a click-test of the app.
>>>> 
> Yes, I was trying from the host OS.  I do have KDE installed in Linux so I 
> can browse to the Webrick link.
> 
>> Therefore, I had my VirtualBox setup with Ubuntu and using Apache2 on port 
>> 8080, which I could get to from my host OS.  I wasn’t seeing that test app 
>> described at the above link, until I went into the folder 
>> http://localhost:8080/test_app/
>>     Of course, now, for some reason, I cannot get into any of the apps that 
>> I just installed hours ago.  I get Not Found at the test_app link that I 
>> included just above.  I can go to the http://localhost:8080/ uri and see 
>> some web content that was put there.  However, the test_app that worked fine 
>> just a little while ago, is not working now.  Had it been working I would 
>> have said that the last problem to address is creating an application with 
>> mysql support.
> 
> Not sure what this all means, but I would still try to see the site from 
> within the linux environment, if that's where it is running (that is, if it 
> was started with `rails server` from within the folder in a terminal).
>>>> 
> I wonder why I cannot get an app created in RoR with support for mysql?

Please copy and paste the exact rails new … command you typed into terminal 
when you created your test app. 

There are tons of flags you can use to set up rails with various databases. By 
default, it will use SQLite3, because that just works most places. If you pass 
-d mysql to the new command, you will get a mysql connector. But note that you 
don't have to do this at the beginning of your project. You can create a 
default (SQLite) application, then transfer it to MySQL or PostgreSQL or 
anything else that's supported, later in the project life-cycle by changing a 
few lines of your gemfile and database.yml files.

> 
> If you have Apache running inside virtualbox, and you can see a test site 
> (the classic It Works! page) at :8080 from your host OS, then you need to set 
> up passenger inside Linux, configure each virtual host where you want to run 
> Rails, and it should just work. Passenger on Linux is a very patient and 
> instructive installer script, so much so that I have not yet failed to get it 
> running on a bare VPS, despite my home-school approach to Linux admin.
>>>>> 
> Can you expand on this?  What will Passenger do?

Passenger is one of the ways to serve Rails applications. Think of it as 
mod_php but for Rails. It's an Apache module that understands the structure of 
a Rails application and how to pass Web requests from Apache into Rails. Learn 
more at http://modrails.org

> 
>>      It is frustrating that my problem is now apparently related to my Linux 
>> installation on my system and I cannot address the other issues of moving on 
>> to learning RoR.

I would take the patient advice of many others on this list, and please put 
down the Lynda tutorial. Pick up the http://railstutorial.org path instead. 
This is a FREE course that teaches you how to go from nothing to a working, 
tested Rails app hosted on Heroku (which is also free) and will give you the 
leg up you need without immersing you in the minutia of installation hell where 
you seem to be circling. You will still want to get a working local install of 
Rails, which will include being able to browse your test site (hosted out of 
Webrick) locally at http://localhost:3000 But that is really not as hard as 
your combination of aged tutorial and lack of experience in Linux is giving 
you. There are even instructions in railstutorial that will show you how to get 
Rails installed directly under Windows, although I would urge you to charge on 
and get it to work in your Linux environment instead.

>> 1) test_app from the tutorial: 
>> http://blog.sudobits.com/2012/05/02/how-to-install-ruby-on-rails-in-ubuntu-12-04-lts/
>>  **was** working fine with apache2, not with Webrick.  Unlike in that 
>> tutorial, I couldn’t go to just http://localhost:8080 or localhost:3000, I 
>> had to add the directory in my browsers address bar, then I think I had to 
>> go into public.
>> 2)  How are you installing the mysql2 gem?  Are you using Bundler?  In the 
>> above referenced tutorial, I didn’t need mysql.  However, when I added that 
>> to the command line:
>> rails new simple_cms –d mysql
>> I got the message: “An error occurred while installing mysql2 (0.3.11), and 
>> Bundler cannot continue.  Make sure that ‘gem install mysqsl2 –v ‘0.3.11’` 
>> succeeds before bundling.  So, I then enter
>> gem install mysql2 –v ‘0.3.11’
>> Then I try my install again... when asked to continue and over-write, I say 
>> Y.  Then I get the same error.
>> What is curious is that if I include the ` after the gem install mysql –v 
>> ‘0.3.11’ it gives me a different prompt.
>> 3) Is the gem specified in the Gemfile?   Were you able to rake db:migrate 
>> or is that where you're having your problem?
>> I don’t know what the latter means.  I can look at the Gemfile and it has 
>> this in it:
>> source :rubygems
>> 
>> gemspec
> 
> Your gemfile should have quite a bit more than that inside it, at least on a 
> bare Rails app. Here's one now:
> 
> source 'https://rubygems.org'
> 
> gem 'rails', '3.2.7'
> 
> # Bundle edge Rails instead:
> # gem 'rails', :git => 'git://github.com/rails/rails.git'
> 
> gem 'sqlite3'
> 
> 
> # Gems used only for assets and not required
> # in production environments by default.
> group :assets do
> gem 'sass-rails',   '~> 3.2.3'
> gem 'coffee-rails', '~> 3.2.1'
> 
> # See https://github.com/sstephenson/execjs#readme for more supported runtimes
> # gem 'therubyracer', :platforms => :ruby
> 
> gem 'uglifier', '>= 1.0.3'
> end
> 
> gem 'jquery-rails'
> 
> # To use ActiveModel has_secure_password
> # gem 'bcrypt-ruby', '~> 3.0.0'
> 
> # To use Jbuilder templates for JSON
> # gem 'jbuilder'
> 
> # Use unicorn as the app server
> # gem 'unicorn'
> 
> # Deploy with Capistrano
> # gem 'capistrano'
> 
> # To use debugger
> # gem 'debugger'
> 
> IF that file exists at the base of your rails root, and you cd into that 
> folder and type bundle install, you should see a lot of terminal whizz by, 
> and your app should suddenly have everything it needs to start up properly.
>>>> 
> How do I get a Gemfile that is like that?  My installation process didn't 
> seem to work.

Again. Please post the rails new command that you typed (at its most basic, 
this will be `rails new mynewapp` and it will be followed by a bunch of 
feedback from the rails command, culminating in a working Rails app). Also post 
the output of rails -v in your terminal.

>> 
>> I know it is somewhat off topic, but I have to somehow figure out why the 
>> apps I created previously, php and the RoR app (without the msyql support) 
>> are not now accessible from a browser.
> 
> You've probably borked your Apache install somewhat. See if you can get to a 
> bare virtual host, just a folder with index.html in it. IF that works, then 
> go up a level and make sure that passenger is properly installed, and you've 
> configured a new virtual host for your Rails app. Don't try to share a vhost 
> with another app.
>>>> 
> I need to learn more.  Like how to get a bare virtual host... do you mean 
> reinstall apache somehow?  Create a new install of Ubuntu in the VirtualBox?
> I do have root access to a dedicated server but it uses CentOS and so that is 
> different and I'm only just now learning Linux.

If you started with a distribution of Linux that included Apache already 
configured, you may have a working copy of Apache. Try launching Apache in your 
terminal:

sudo apachectl configtest
sudo apachectl start

(substitute apache2ctl if apachectl doesn't work -- depends on the distro)

If configtest doesn't report any errors, start may tell you Apache is already 
running. If not, it will start it. When Apache is running, then try going to 
http://localhost in your Linux browser, and see what you see there. You should 
see the default host, which in many Ubuntu versions is a white page with the 
words It Works! really big at the top.

If that works, then move on to installing Passenger, which will get you a 
connection between Apache and Rails. The Passenger installer will probably tell 
you to install a half-dozen packages, and it will tell you explicitly how to do 
this. Like I said, it's very patient.

Walter

> Thanks,
> Bruce
> 
> Walter
> 
>> Thanks,
>> Bruce
>> 
>> 
>> 
>> 
>> 
>> From: Bill Walton
>> Sent: Sunday, September 2, 2012 7:29 AM
>> To: rubyonrails-talk@googlegroups.com
>> Subject: Re: [Rails] Help getting started: Newbie: Windows and Rails
>> 
>> Hi Bruce,
>> 
>> On Sun, Sep 2, 2012 at 6:00 AM, Bruce Whealton <br...@whealton.info> wrote:
>> <snip>
>> 
>> 
>> Anyway, I keep going in circles.  I get a message saying that I need to 
>> install gem msyql2 which I do and it reports back with no error and so I try 
>> again to install the app with the rails command and I get the same error.
>> 
>> 
>> I took a quick look at that tutorial, and if that's all you did you should 
>> be getting the index.html file that Rails installs (the tutorial left out 
>> the part where it tells you that you have to delete it).  If you did that, 
>> then you're into the app itself and your problem description doesn't say 
>> much about what you did in addition to the tutorial.
>> 
>> 
>> So.... need a little more info.  How are you installing the mysql2 gem? Are 
>> you using Bundler?  Is the gem specified in the Gemfile?   Were you able to 
>> rake db:migrate or is that where you're having your problem?
>> 
>> Best regards,
>> Bill
>> -- 
>> 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 rubyonrails-talk@googlegroups.com.
>> To unsubscribe from this group, send email to 
>> rubyonrails-talk+unsubscr...@googlegroups.com.
>> For more options, visit https://groups.google.com/groups/opt_out.
>> 
>> 
>> 
>> -- 
>> 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 rubyonrails-talk@googlegroups.com.
>> To unsubscribe from this group, send email to 
>> rubyonrails-talk+unsubscr...@googlegroups.com.
>> For more options, visit https://groups.google.com/groups/opt_out.
>> 
>> 
> 
> -- 
> 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 rubyonrails-talk@googlegroups.com.
> To unsubscribe from this group, send email to 
> rubyonrails-talk+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/groups/opt_out.
> 
> -- 
> 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 rubyonrails-talk@googlegroups.com.
> To unsubscribe from this group, send email to 
> rubyonrails-talk+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/groups/opt_out.
> 
> 

-- 
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 rubyonrails-talk@googlegroups.com.
To unsubscribe from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to