Complete Newbie needs help!

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

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

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

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

Wahey! ok, my server is running.

I started this tutorial:

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

Thanks,
Abhinav

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

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

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

Please do what it says, install mysql gem. Also using Internet search
for
such simple problems does help.

Thanks,
Abhinav

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

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

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

Yeah, i have tried installing the gem but it wont work. it keeps
giving me the last error that i posted above.

brad

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

I cant seem to figure this out at the moment, but thank you very much
for your help.

Brad

You can read this thread: http://www.ruby-forum.com/topic/125473 It
discusses the same problem.


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

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

John T. wrote:

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

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
[email protected]

Okay, I suspected that this will be your next question :slight_smile: 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

In response to marnen, it points to apples ( i think ): /usr/local/bin/
ruby

Brad

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
[email protected]