Error installing gems for Rails 3.0.0.beta4 on MacOSx

I tried to install Rails 3 Beta in my snow.leopard machine using the
command below: (w/ sudo if it requires)

gem install tzinfo builder memcache-client rack rack-test rack-mount
erubis mail text-format thor bundler i18n

unfortunately after 12 gems installed i got an error regarding
builder-2.1.2

12 gems installed
Installing ri documentation for tzinfo-0.3.22…
Installing ri documentation for builder-2.1.2…
ERROR: While generating documentation for builder-2.1.2
… MESSAGE: Unhandled special: Special: type=17, text=""
… RDOC args: --ri --op /Library/Ruby/Gems/1.8/doc/builder-2.1.2/ri
–title Builder – Easy XML Building --main README --line-numbers
–quiet lib CHANGES Rakefile README doc/releases/builder-1.2.4.rdoc
doc/releases/builder-2.0.0.rdoc doc/releases/builder-2.1.1.rdoc --title
builder-2.1.2 Documentation
(continuing with the rest of the installation)

any idea on this ?
So i continue the command below:
sudo gem install rails --pre

I manage to install 3.0.0.beta4 in my machine but when I start creating
a rails3sample application and run a rake db:migrate for default SQLite3
database. It didn’t work out … (any help needed on this) ERROR
below.

(in /Users/andre/Desktop/Andre/sampleapps/rails3sample)
rake aborted!
spec sqlite3-ruby-1.3.0 is not from an installed gem
/Users/andre/Desktop/Andre/sampleapps/rails3sample/Rakefile:4
(See full trace by running task with --trace)

Hey Andre,

I would recommend a few things that could make your life easier.

Use RVM. It allows you to easily install a local user copy of ruby
without mucking about with your system. Follow the instructions at
http://rvm.beginrescueend.com/rvm/install/ and remember - you don’t
have to be root. In fact, doing this stuff as root is discouraged
unless you have a great reason to.

For rails 3 I would recommend either ruby 1.8.7-p299 or 1.9.2-
preview3. After you install rvm into your home directory in terminal,
do an “rvm install ruby-1.8.7-p299” to get a good version of ruby
running.

from there, try your gem install rails --pre. and remember, doing
everything from rvm means you no longer have to sudo anything. all
your gems are installed on a per ruby basis and gives you a lot of
control without forcing you to do a lot of work.

hope this helps.

  • FJM

Also I should have noted, after you get rails installed and run
rails new MyNewAppName you should cd to that directory and run
bundle install
that will install all of your gem dependencies from your Gemfile and
you shouldn’t get that sqlite3-ruby error anymore.

On Jun 25, 1:00 am, “[email protected][email protected]

[email protected] wrote:

Also I should have noted, after you get rails installed and run
rails new MyNewAppName you should cd to that directory and run
bundle install
that will install all of your gem dependencies from your Gemfile and
you shouldn’t get that sqlite3-ruby error anymore.

On Jun 25, 1:00�am, “[email protected][email protected]

Hi Frank,

Thank for the help, i really wanted this one to get up straight. I
tried the instructions from http://rvm.beginrescueend.com/rvm/install/
and it works fine. I keep on turning around “/usr/bin/rvm install” but
no record so i tried “usr/bin/rvm-install ruby-1.8.7-p299” and it did
work. :slight_smile: thanks for tha. No i tried to get into my “rails3sample” app
directory and run the command: bundle install and yet another errors
coming up. (kindly check below) seems like i have
sqlite3 gem missing or something somewhere => “checking for
sqlite3_libversion_number() in -lsqlite3… no”

Using rake (0.8.7) from system gems
Using abstract (1.0.0) from system gems
Using activesupport (3.0.0.beta4) from system gems
Using builder (2.1.2) from system gems
Using i18n (0.4.1) from system gems
Using activemodel (3.0.0.beta4) from system gems
Using erubis (2.6.5) from system gems
Using rack (1.1.0) from system gems
Using rack-mount (0.6.6) from system gems
Using rack-test (0.5.4) from system gems
Using tzinfo (0.3.22) from system gems
Using actionpack (3.0.0.beta4) from system gems
Using mime-types (1.16) from system gems
Using polyglot (0.3.1) from system gems
Using treetop (1.4.8) from system gems
Using mail (2.2.5) from system gems
Using actionmailer (3.0.0.beta4) from system gems
Using arel (0.4.0) from system gems
Using activerecord (3.0.0.beta4) from system gems
Using activeresource (3.0.0.beta4) from system gems
Using bundler (0.9.26) from system gems
Using thor (0.13.6) from system gems
Using railties (3.0.0.beta4) from system gems
Using rails (3.0.0.beta4) from system gems
Installing sqlite3-ruby (1.3.0) from .gem files at
/Users/andre/.bundle/ruby/1.8/cache with native extensions
/Library/Ruby/Site/1.8/rubygems/installer.rb:483:in `build_extensions’:
ERROR: Failed to build gem native extension.
(Gem::Installer::ExtensionBuildError)

/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/bin/ruby
extconf.rb
checking for sqlite3.h… yes
checking for sqlite3_libversion_number() in -lsqlite3… no
sqlite3 is missing. Try ‘port install sqlite3 +universal’ or ‘yum
install sqlite3-devel’
*** 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=/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/bin/ruby
–with-sqlite3-dir
–without-sqlite3-dir
–with-sqlite3-include
–without-sqlite3-include=${sqlite3-dir}/include
–with-sqlite3-lib
–without-sqlite3-lib=${sqlite3-dir}/lib
–with-sqlite3lib
–without-sqlite3lib

Gem files will remain installed in
/Users/andre/.bundle/ruby/1.8/gems/sqlite3-ruby-1.3.0 for inspection.
Results logged to
/Users/andre/.bundle/ruby/1.8/gems/sqlite3-ruby-1.3.0/ext/sqlite3/gem_make.out
from /Library/Ruby/Site/1.8/rubygems/installer.rb:446:in each' from /Library/Ruby/Site/1.8/rubygems/installer.rb:446:in build_extensions’
from /Library/Ruby/Site/1.8/rubygems/installer.rb:198:in install' from /Library/Ruby/Gems/1.8/gems/bundler-0.9.26/lib/bundler/source.rb:170:in install’
from
/Library/Ruby/Gems/1.8/gems/bundler-0.9.26/lib/bundler/installer.rb:34:in
run' from /Library/Ruby/Gems/1.8/gems/bundler-0.9.26/lib/bundler/spec_set.rb:12:in each’
from
/Library/Ruby/Gems/1.8/gems/bundler-0.9.26/lib/bundler/spec_set.rb:12:in
each' from /Library/Ruby/Gems/1.8/gems/bundler-0.9.26/lib/bundler/installer.rb:21:in run’
from
/Library/Ruby/Gems/1.8/gems/bundler-0.9.26/lib/bundler/installer.rb:6:in
install' from /Library/Ruby/Gems/1.8/gems/bundler-0.9.26/lib/bundler/cli.rb:91:in install’
from
/Library/Ruby/Gems/1.8/gems/bundler-0.9.26/lib/bundler/vendor/thor/task.rb:33:in
send' from /Library/Ruby/Gems/1.8/gems/bundler-0.9.26/lib/bundler/vendor/thor/task.rb:33:in run’
from
/Library/Ruby/Gems/1.8/gems/bundler-0.9.26/lib/bundler/vendor/thor/invocation.rb:109:in
invoke' from /Library/Ruby/Gems/1.8/gems/bundler-0.9.26/lib/bundler/vendor/thor/invocation.rb:116:in call’
from
/Library/Ruby/Gems/1.8/gems/bundler-0.9.26/lib/bundler/vendor/thor/invocation.rb:116:in
invoke' from /Library/Ruby/Gems/1.8/gems/bundler-0.9.26/lib/bundler/vendor/thor.rb:137:in start’
from
/Library/Ruby/Gems/1.8/gems/bundler-0.9.26/lib/bundler/vendor/thor/base.rb:378:in
start' from /Library/Ruby/Gems/1.8/gems/bundler-0.9.26/lib/bundler/vendor/thor.rb:124:in start’
from /Library/Ruby/Gems/1.8/gems/bundler-0.9.26/bin/bundle:13
from /usr/bin/bundle:19:in `load’
from /usr/bin/bundle:19

it looks like you either installed rvm as root or are running it as
such… I’m not sure exactly.

either way. you shouldnt have to involve “usr/bin” in anything. all
your commands should be directly from your home user directory.
done that way, rvm will then install a version of ruby for you right
in your ~/.rvm directory. after rvm is correctly installed you should
never see gem trying to use /Library system gems.

after you install rvm it should give tell you how to set up your
terminal to run it when you open it. rvm provies instructions for this
but it generally involves adding the following line to
your .bash_profile file

if [[ -s ~/.rvm/scripts/rvm ]] ; then source ~/.rvm/scripts/rvm ; fi

after that you probably should close your terminal and reopen it…

then from your user home directory in terminal, run “rvm install
ruby-1.8.7-p299” after that you’ll need to set it as the default ruby
for new shells… i believe the command is
rvm 1.8.7 --default

now that your environment is set up correctly… try

gem install rails --pre

it should install your gems into your local .rvm folder under the
version of ruby you installed.
let me know how that goes.

[email protected] wrote:

it looks like you either installed rvm as root or are running it as
such… I’m not sure exactly.

either way. you shouldnt have to involve “usr/bin” in anything. all
your commands should be directly from your home user directory.
done that way, rvm will then install a version of ruby for you right
in your ~/.rvm directory. after rvm is correctly installed you should
never see gem trying to use /Library system gems.

after you install rvm it should give tell you how to set up your
terminal to run it when you open it. rvm provies instructions for this
but it generally involves adding the following line to
your .bash_profile file

if [[ -s ~/.rvm/scripts/rvm ]] ; then source ~/.rvm/scripts/rvm ; fi

after that you probably should close your terminal and reopen it…

then from your user home directory in terminal, run “rvm install
ruby-1.8.7-p299” after that you’ll need to set it as the default ruby
for new shells… i believe the command is
rvm 1.8.7 --default

now that your environment is set up correctly… try

gem install rails --pre

it should install your gems into your local .rvm folder under the
version of ruby you installed.
let me know how that goes.

Thank you for the help frank :slight_smile: i appreciate.
Now running my sample up I got an issue after I install the bundler in
the gem directory and now its getting me sick turning around my head.

When i tried to run scirpt s
sqlite3-ruby-1.3.0 is cached, but not installed.
Try running bundle install.

so I tried ‘bundle install’

So this time. :frowning: the sqlite3-ruby (1.3.0) is the major issue at this
moment.

Installing sqlite3-ruby (1.3.0) from .gem files at
/Users/andre/.bundle/ruby/1.8/cache with native extensions
/Library/Ruby/Site/1.8/rubygems/installer.rb:483:in `build_extensions’:
ERROR: Failed to build gem native extension.
(Gem::Installer::ExtensionBuildError)

/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/bin/ruby
extconf.rb
checking for sqlite3.h… yes
checking for sqlite3_libversion_number() in -lsqlite3… no
sqlite3 is missing. Try ‘port install sqlite3 +universal’ or ‘yum
install sqlite3-devel’
*** 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.

Thanks for your time