Complete Newbie needs help!

4 views
Skip to first unread message

Brad

unread,
Sep 11, 2009, 3:44:52 AM9/11/09
to Ruby on Rails: Talk
Hey,

I am so stoked to learn rails. i am on an iMac so i know it's pre-
installed. I have installed rubystack.

I would like to know how to start my project etc. I have tried a
number of tutorials including creating a simple blog from the
rails.org site but i fall down every time at, what i think is the same
place.

Yesterday i got as far as getting the "Welcome aboard" page running,
which i presume means my servers etc are on.

Today, however, i started the server and if i didn't get this message:
"/Applications/rubystack-1.6-0/ruby/bin/.ruby.bin: No such file or
directory — scripts/server (LoadError)"

i got others such as: the "welcome aboard" page which goes mental if
you click the drop down link at the top. it says "something went wrong
and we have been notified" or something like that.

basically i need some help, please!

brad

Abhinav Saxena

unread,
Sep 11, 2009, 4:36:46 AM9/11/09
to rubyonra...@googlegroups.com
Hi Brad,

I have never used Mac, so essentially can't you much. But you seem to mistyping "script/server" as "scripts/server", ie, you should use script (singular)

Thanks,
Abhinav
--
अभिनव
http://twitter.com/abhinav

Brad

unread,
Sep 11, 2009, 4:45:26 AM9/11/09
to Ruby on Rails: Talk
Hey,

Thanks for your reply. i just changed it to script/server and got
this: Rails requires RubyGems >= 1.3.1. Please install RubyGems and
try again: http://rubygems.rubyforge.org

I am pretty sure the gems were there yesterday and i dont think i did
anything that would have got rid of them.

Brad

On Sep 11, 9:36 am, Abhinav Saxena <abhinav...@gmail.com> wrote:
> Hi Brad,
>
> I have never used Mac, so essentially can't you much. But you seem to
> mistyping "script/server" as "scripts/server", ie, you should use script
> (singular)
>
> Thanks,
> Abhinav
> --
> अभिनवhttp://twitter.com/abhinav

Abhinav Saxena

unread,
Sep 11, 2009, 5:06:01 AM9/11/09
to rubyonra...@googlegroups.com
RubyGems might be there, but not the appropriate version necessarily.

On command prompt do this
> gem -v
If its < 1.3.1 then, install >= 1.3.1 as suggested by the error message.


Thanks,
Abhinav
--
अभिनव
http://twitter.com/abhinav

Brad

unread,
Sep 11, 2009, 6:28:57 AM9/11/09
to Ruby on Rails: Talk
Wahey! ok, my server is running.

I started this tutorial: http://guides.rubyonrails.org/getting_started.html#creating-a-new-rails-project

when i get to rake db:create it tells me that the mysql.sock (i think
thats it) is missing or not there and to install it.

In my /Applications/rubystack-1.6-0/mysql/tmp/mysql.sock folder, it's
definiteley there.

im still confused but getting there!

Brad

On Sep 11, 10:06 am, Abhinav Saxena <abhinav...@gmail.com> wrote:
> RubyGems might be there, but not the appropriate version necessarily.
>
> On command prompt do this> gem -v
>
> If its < 1.3.1 then, install >= 1.3.1 as suggested by the error message.
>
> Thanks,
> Abhinav
> --
> अभिनवhttp://twitter.com/abhinav

Abhinav Saxena

unread,
Sep 11, 2009, 6:54:39 AM9/11/09
to rubyonra...@googlegroups.com

Brad

unread,
Sep 11, 2009, 7:06:07 AM9/11/09
to Ruby on Rails: Talk
Thanks for your reply. I had a look at my database.yml file and the
socket path is correctly referenced.

i did rake db:create and got this:

(in /Applications/rubystack-1.6-0/projects/rubystack)
Missing the Rails 2.3.2 gem. Please `gem install -v=2.3.2 rails`,
update your RAILS_GEM_VERSION setting in config/environment.rb for the
Rails version you do have installed, or comment out RAILS_GEM_VERSION
to use the latest version installed.

so i did what it told me and entered this: gem install -v=2.3.2 rails

and i got this back: WARNING: Installing to ~/.gem since /usr/local/
lib/ruby/gems/1.8 and
/usr/local/bin aren't both writable.
WARNING: You don't have /Users/bradbucceri/.gem/ruby/1.8/bin in your
PATH,
gem executables will not run.

Brad

On Sep 11, 11:54 am, Abhinav Saxena <abhinav...@gmail.com> wrote:
> http://rubyresponse.wordpress.com/2006/07/22/cant-find-mysqldsock/
>
> Thanks,
> Abhinav
> --
> अभिनवhttp://twitter.com/abhinav
>
> On Fri, Sep 11, 2009 at 3:58 PM, Brad <b...@plastikcow.com> wrote:
>
> > Wahey! ok, my server is running.
>
> > I started this tutorial:
> >http://guides.rubyonrails.org/getting_started.html#creating-a-new-rai...

Abhinav Saxena

unread,
Sep 11, 2009, 7:23:56 AM9/11/09
to rubyonra...@googlegroups.com
You should install any gem with sudo
  example: sudo gem install rails

Anyway, I guess, you generated the application you are working one with a different rails version than it is currently installed. So I think, updating RAILS_GEM_VERSION with the correct version will be much simpler. Try that. Or if it is just a sample app, discard it, and generate a new one.


Thanks,
Abhinav
--
अभिनव
http://twitter.com/abhinav

Brad

unread,
Sep 11, 2009, 7:47:14 AM9/11/09
to Ruby on Rails: Talk
ok, so i entered this sudo gem install -v=2.3.2 rails

it gave me this:

Successfully installed actionmailer-2.3.2
Successfully installed activeresource-2.3.2
Successfully installed rails-2.3.2
3 gems installed
Installing ri documentation for actionmailer-2.3.2...
Installing ri documentation for activeresource-2.3.2...
Installing ri documentation for rails-2.3.2...
Installing RDoc documentation for actionmailer-2.3.2...
Installing RDoc documentation for activeresource-2.3.2...
Installing RDoc documentation for rails-2.3.2...

so i then tried this again: rake db:create

and it gave me this:

(in /Applications/rubystack-1.6-0/projects/rubystack)
!!! The bundled mysql.rb driver has been removed from Rails 2.2.
Please install the mysql gem and try again: gem install mysql.
rake aborted!
no such file to load -- mysql

(See full trace by running task with --trace)



Brad

On Sep 11, 12:23 pm, Abhinav Saxena <abhinav...@gmail.com> wrote:
> You should install any gem with sudo
>   example: sudo gem install rails
>
> Anyway, I guess, you generated the application you are working one with a
> different rails version than it is currently installed. So I think, updating
> RAILS_GEM_VERSION with the correct version will be much simpler. Try that.
> Or if it is just a sample app, discard it, and generate a new one.
>
> Thanks,
> Abhinav
> --
> अभिनवhttp://twitter.com/abhinav

Abhinav Saxena

unread,
Sep 11, 2009, 7:59:31 AM9/11/09
to rubyonra...@googlegroups.com
Please do what it says, install mysql gem. Also using Internet search for such simple problems does help.


Thanks,
Abhinav
--
अभिनव
http://twitter.com/abhinav

Brad

unread,
Sep 11, 2009, 8:10:37 AM9/11/09
to Ruby on Rails: Talk
Yeah, i have tried installing the gem but it wont work. it keeps
giving me the last error that i posted above.

brad

On Sep 11, 12:59 pm, Abhinav Saxena <abhinav...@gmail.com> wrote:
> Please do what it says, install mysql gem. Also using Internet search for
> such simple problems does help.
>
> Thanks,
> Abhinav
> --
> अभिनवhttp://twitter.com/abhinav

Abhinav Saxena

unread,
Sep 11, 2009, 8:21:01 AM9/11/09
to rubyonra...@googlegroups.com
Instead of using rake to install mysql gem, use "sudo gem install mysql". I think this should work fine.

--

Thanks,
Abhinav

--
अभिनव
http://twitter.com/abhinav

Brad

unread,
Sep 11, 2009, 8:23:39 AM9/11/09
to Ruby on Rails: Talk
I tried your suggestion and got this:

Building native extensions. This could take a while...
ERROR: Error installing mysql:
ERROR: Failed to build gem native extension.

/usr/local/bin/ruby extconf.rb
checking for mysql_query() in -lmysqlclient... no
checking for main() in -lm... yes
checking for mysql_query() in -lmysqlclient... no
checking for main() in -lz... yes
checking for mysql_query() in -lmysqlclient... no
checking for main() in -lsocket... no
checking for mysql_query() in -lmysqlclient... no
checking for main() in -lnsl... no
checking for mysql_query() in -lmysqlclient... no
checking for main() in -lmygcc... no
checking for mysql_query() in -lmysqlclient... no
*** extconf.rb failed ***
Could not create Makefile due to some reason, probably lack of
necessary libraries and/or headers. Check the mkmf.log file for more
details. You may need configuration options.

Provided configuration options:
--with-opt-dir
--without-opt-dir
--with-opt-include
--without-opt-include=${opt-dir}/include
--with-opt-lib
--without-opt-lib=${opt-dir}/lib
--with-make-prog
--without-make-prog
--srcdir=.
--curdir
--ruby=/usr/local/bin/ruby
--with-mysql-config
--without-mysql-config
--with-mysql-dir
--without-mysql-dir
--with-mysql-include
--without-mysql-include=${mysql-dir}/include
--with-mysql-lib
--without-mysql-lib=${mysql-dir}/lib
--with-mysqlclientlib
--without-mysqlclientlib
--with-mlib
--without-mlib
--with-mysqlclientlib
--without-mysqlclientlib
--with-zlib
--without-zlib
--with-mysqlclientlib
--without-mysqlclientlib
--with-socketlib
--without-socketlib
--with-mysqlclientlib
--without-mysqlclientlib
--with-nsllib
--without-nsllib
--with-mysqlclientlib
--without-mysqlclientlib
--with-mygcclib
--without-mygcclib
--with-mysqlclientlib
--without-mysqlclientlib


Gem files will remain installed in /usr/local/lib/ruby/gems/1.8/gems/
mysql-2.8.1 for inspection.
Results logged to /usr/local/lib/ruby/gems/1.8/gems/mysql-2.8.1/ext/
mysql_api/gem_make.out

is there a specific directory or folder i should be in to do this?

Sorry, i am very new to this.

Brad

On Sep 11, 1:21 pm, Abhinav Saxena <abhinav...@gmail.com> wrote:
> Instead of using rake to install mysql gem, use "sudo gem install mysql". I
> think this should work fine.
>
> --
> Thanks,
> Abhinav
>
> --
> अभिनवhttp://twitter.com/abhinav

Abhinav Saxena

unread,
Sep 11, 2009, 8:32:31 AM9/11/09
to rubyonra...@googlegroups.com
Okay, I suspected that this will be your next question :-) Do you have mysql (as in database) installed? Also, I believe you need to install devel packages for mysql. I don't know how to install packages on a Mac, so please use Internet search.


Thanks,
Abhinav
--
अभिनव
http://twitter.com/abhinav

Brad

unread,
Sep 11, 2009, 8:42:30 AM9/11/09
to Ruby on Rails: Talk
I cant seem to figure this out at the moment, but thank you very much
for your help.

Brad

On Sep 11, 1:32 pm, Abhinav Saxena <abhinav...@gmail.com> wrote:
> Okay, I suspected that this will be your next question :-) Do you have mysql
> (as in database) installed? Also, I believe you need to install devel
> packages for mysql. I don't know how to install packages on a Mac, so please
> use Internet search.
>
> Thanks,
> Abhinav
> --
> अभिनवhttp://twitter.com/abhinav
> ...
>
> read more »

Abhinav Saxena

unread,
Sep 11, 2009, 8:57:51 AM9/11/09
to rubyonra...@googlegroups.com
You can read this thread: http://www.ruby-forum.com/topic/125473 It discusses the same problem.

--
अभिनव
http://twitter.com/abhinav

John T.

unread,
Sep 11, 2009, 9:02:04 AM9/11/09
to rubyonra...@googlegroups.com
Brad wrote:
> I cant seem to figure this out at the moment, but thank you very much
> for your help.
>
> Brad

Do you have XCode (Mac OS X developer tools) installed? The installer is
on your OS install disk, or can be downloaded free from
www.apple.com/developer.

Also, try using SQLite, instead of jumping into MySQL. You will need to
change your database.yml file to look something like:

development:
adapter: sqlite3
database: db/development.sqlite3

and I don't recall if OS X comes with the SQLite gem installed, so do:

sudo gem install sqlite3-ruby
--
Posted via http://www.ruby-forum.com/.

Marnen Laibow-Koser

unread,
Sep 11, 2009, 9:13:47 AM9/11/09
to rubyonra...@googlegroups.com

I do not think I would advise using SQLite -- it's kind of underpowered
for Rails, as I understand. I would, however, suggest using PostgreSQL
instead of mySQL.

There are many websites with instructions on how to get all this
running. If you find a tutorial for Tiger or earlier, just disregard
the part about installing Ruby.

However, I'm not sure why you bothered with Rubystack. Mac OS's dev
tools include Ruby and Rails already, and the other components are easy
to install on their own. If you type 'which ruby', does that point to
Apple's Ruby or Rubystack's Ruby? Some of this might be path issues.

Best,
--
Marnen Laibow-Koser
http://www.marnen.org
mar...@marnen.org

Brad

unread,
Sep 11, 2009, 9:17:56 AM9/11/09
to Ruby on Rails: Talk
hey john,

thanks. i will try that now. i have xcode installed. Before posting on
here i posted on another forum. I was doing this tutorial:
http://developer.apple.com/Tools/developonrailsleopard.html

i got to point 7 where is says to start the server after doing
everything that is says above it.

I got this error from the debugger:

[Session started at 2009-09-10 09:20:44 +0100.]
env: ruby: No such file or directory

The Debugger has exited with status 127.The Debugger has exited with
status 127.

On the other forum, someone suggested that i use rubystack and thats
where i started having the other problems listed above. if you could
tell me what is up with the error above i will be more than happy :)

Im off to try your first suggestion.

Brad

On Sep 11, 2:02 pm, "John T." <rails-mailing-l...@andreas-s.net>
wrote:

Brad

unread,
Sep 11, 2009, 9:21:54 AM9/11/09
to Ruby on Rails: Talk
In response to marnen, it points to apples ( i think ): /usr/local/bin/
ruby

Brad

Marnen Laibow-Koser

unread,
Sep 11, 2009, 9:30:24 AM9/11/09
to rubyonra...@googlegroups.com
Brad wrote:
> In response to marnen

Learn to use the quoting feature in your e-mail or forum client!

>, it points to apples ( i think ): /usr/local/bin/
> ruby

I don't think that's Apple's Ruby. Do a ls -l on that to see if it's a
aymlink and, if so, to what. If it's Apple's, it should point to
something in /Library/Frameworks. If it's Rubystack's...well...I'm not
sure. Check docs for where Rubystack installs stuff.

If I were you, I'd remove Rubystack and just use Apple's Ruby.

>
> Brad

Best,
--
Marnen Laibow-Koser
http://www.marnen.org
mar...@marnen.org

Marnen Laibow-Koser

unread,
Sep 11, 2009, 9:30:43 AM9/11/09
to rubyonra...@googlegroups.com
Brad wrote:
> In response to marnen

Learn to use the quoting feature in your e-mail or forum client!

>, it points to apples ( i think ): /usr/local/bin/
> ruby

I don't think that's Apple's Ruby. Do a ls -l on that to see if it's a
symlink and, if so, to what. If it's Apple's, it should point to

something in /Library/Frameworks. If it's Rubystack's...well...I'm not
sure. Check docs for where Rubystack installs stuff.

If I were you, I'd remove Rubystack and just use Apple's Ruby.

>
> Brad

Best,
--
Marnen Laibow-Koser
http://www.marnen.org
mar...@marnen.org

John T.

unread,
Sep 11, 2009, 9:42:19 AM9/11/09
to rubyonra...@googlegroups.com
Marnen Laibow-Koser wrote:

> I do not think I would advise using SQLite -- it's kind of underpowered
> for Rails, as I understand. I would, however, suggest using PostgreSQL
> instead of mySQL.

I'm not suggesting use SQLite for production, but for development.
SQLite is just fine, and is plenty powerful. Not to mention for someone
just getting into Rails, one less thing to deal with - setting up a
whole database server like MySql and Postgres. SQLite is built into OS
X, and as I've reminded myself, the gem is already installed in OS X.
(Many services and applications use SQLite as their backend database -
Safari, Firefox to name two)

Marnen Laibow-Koser

unread,
Sep 11, 2009, 9:47:04 AM9/11/09
to rubyonra...@googlegroups.com
John T. wrote:
> Marnen Laibow-Koser wrote:
>
>> I do not think I would advise using SQLite -- it's kind of underpowered
>> for Rails, as I understand. I would, however, suggest using PostgreSQL
>> instead of mySQL.
>
> I'm not suggesting use SQLite for production, but for development.
> SQLite is just fine, and is plenty powerful.

Not if you're used to actually using relatively powerful DB features.
It may indeed be good for a beginner, however.

> Not to mention for someone
> just getting into Rails, one less thing to deal with - setting up a
> whole database server like MySql and Postgres.

Perhaps true. But that has to be done sometime, and problems may arise
with the switch in DBs.

> SQLite is built into OS
> X, and as I've reminded myself, the gem is already installed in OS X.
> (Many services and applications use SQLite as their backend database -
> Safari, Firefox to name two)

I know that -- I believe that the system CoreData routines use it, so
it's easily available. I just don't think it's well suited to Web apps.

Best,
--
Marnen Laibow-Koser
http://www.marnen.org
mar...@marnen.org

Brad

unread,
Sep 11, 2009, 10:09:56 AM9/11/09
to Ruby on Rails: Talk
Hey john,

How do i make mongrel the default server?

Brad

On Sep 11, 2:47 pm, Marnen Laibow-Koser <rails-mailing-l...@andreas-

John T.

unread,
Sep 11, 2009, 10:43:04 AM9/11/09
to rubyonra...@googlegroups.com
Brad wrote:
> Hey john,
>
> How do i make mongrel the default server?
>
> Brad
>

Using the default OS X Leopard setup, it should just use mongrel. Double
check that it is installed:

gem list


*** LOCAL GEMS ***
...

mongrel (1.1.5)

...

AndrewO

unread,
Sep 11, 2009, 11:13:48 AM9/11/09
to Ruby on Rails: Talk
Something fundamental is wrong here. Rails should not be this hard.

First of all, you have installed RubyStack (I asume Bitnami) on your
Mac, which is really not the best idea ever. OSX comes with ruby and
rails preinstalled. The only thing you need to install is a
database. The Bitnami stack is cool for deploying cookie-cutter
installs to clusters of production servers, but is really asking for a
mess of conflicts on a development machine.

I would begin by uninstalling the Bitnami stack. There is an
uninstaller in the application folder. Run it, get some tea, then
come back. The uninstaller will not delete the stack's directory
because they aim to preserve your data (application/DB data). So
after running the uninstaller, just drag the whole folder to the
trash.

Next, do the following at a terminal window:

which ruby
ruby -v
which rails
rails -v

You should get back
/usr/bin/ruby
ruby 1.8.7 (on Snow Leopard, maybe different on Leopard)
/usr/bin/rails
Rails 2.2.2 (again on SL, Leopard may be different)

If this checks out, go to mysql.org, downloads, community edition, and
pick the latest .DMG for OSX. Install. Install the startup script.
If you are on Leopard then install the preference pane. If you are on
SL, then go here: http://www.swoon.net/downloads/MySQL.prefPane.zip
and install the 64 bit pref pane.

Next, open up terminal again and do the following:

Leopard:
sudo gem install mysql −− −−with−mysql−config≡/usr/local/mysql/bin/
mysql_config

Snow Leopard:
env ARCHFLAGS="-arch x86_64" gem install mysql -- --with-mysql-
config=/usr/local/mysql/bin/mysql_config

(note there are two dashes after 'mysql' then a space, then two more
dashes before 'with')

Crack your knuckles, and in the terminal do the following:

cd
rails testapp -d mysql
cd testapp
script/server

Open up your web browser and go to http://localhost:3000 and see if
you can see the "welcome aboard" message. If not post back exactly
what happened at which step.

On Sep 11, 10:43 am, "John T." <rails-mailing-l...@andreas-s.net>
wrote:
Reply all
Reply to author
Forward
0 new messages