Hello,
Thanks Walter for your suggestions and information. I definitely
follow advice. Here's some surprising news. I actually got everything
working right inside Windows while still trying to get things to work in
Linux!!! My Linux installation does not even have the mysql gem or the
mysql2 gem installed. I thought for sure I had it installed earlier.
Some of the issues of trying to get Rails working in Linux as
recommended deal with my ability to do simple things like capture the output
of any command to a file. This would greatly help me to answer some of your
questions about what is going wrong.
I did figure out some things about a rails app that change how I
might try to access a page. For example, if I launch Webrick, and then
navigate to
http://localhost:3000/demo/index
I get my demo controller and index action. It is inside an app called
simple_cms, or it could be in demo_app. However, if I try to visit
http://localhost:3000/simple_cms/demo/index that doesn't work. I get a
"Routing Error" No route matches (GET) "simple_cms/demo/index
So, how does Rails know which application to run if you had many apps
installed? For example, I have a testing environment where I use xampp. I
thought I'd install my rails app there and just use apache which is already
installed on my system. And I have many websites/applications in the htdocs
folder. Therefore, if I wanted to setup a simple cms based on php, I'd
maybe put it in htdocs/simple_cms/ and then I would know that I need to
include the directory simple_cms so that Apache knows how to deliver pages,
with each folder being self-contained. With Rails, how would this work, I
have a folder where I put files, for example the htdocs folder (maybe I
shouldn't use that for the Rails apps to avoid confusion), my sites
directory. So, I might have inside the sites directory the following:
simple_cms
mysecond_app
mythird_app
and these would all be directories under the sites directory. How does Ruby
on Rails know which one to serve?
Ok, at the risk of going off topic and discussing Linux issues,
could I ask that you tell me how I might issue the commands you mention,
such as the rails new command such that the output can be sent to a file
that is easy to find. I currently use putty for Windows and haven't figured
out how to select content and copy it to the Windows clip board so that I
could then paste that to a text editor.
My problems are with regard to where I left off in my Linux
installation of Ruby on Rails, I couldn't get the gem mysql or gem mysql2 to
install. When I type in gem list, I don't see either of those.
I type in my linux sandbox:
rails new demo_app -d mysql
I get Gem::Installer::ExtensionBuildError: ERROR: Failed to build gem native
extension.
Below that, an error occurred while installing mysql2 (0.3.11) and Bundler
cannot continue. Make sure that 'gem install mysql2 -v '0.3.11'` succeeds
before bundling. At which point, I try to do
Sudo Gem install mysql2 and I get asked for my password and then it says the
command sudo gem isn't recognized. So, I try it without sudo and it fails
to install.
I did pick up that book that happens to be directly related to the
tutorial that you sent to me.
Thanks,
Bruce
-----Original Message-----
From: Walter Lee Davis
Sent: Sunday, September 2, 2012 2:18 PM
To:
rubyonra...@googlegroups.com
Subject: Re: [Rails] Help getting started: Newbie: Windows and Rails
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
>> 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