0
votes

I've been trying to get this introduction to work:

http://guides.rubyonrails.org/getting_started.html

When I try this step 'rails generate scaffold Post name:string title:string content:text' I get the following:

Cerberus:app lab49$ rails generate scaffold Post name:string title:string content:text invoke active_record /usr/local/rvm/gems/ruby-1.9.3-p194/gems/activerecord-3.2.6/lib/active_record/connection_adapters/abstract/connection_specification.rb:66:in connection_url_to_hash': undefined methodsub' for nil:NilClass (NoMethodError) from /usr/local/rvm/gems/ruby-1.9.3-p194/gems/activerecord-3.2.6/lib/active_record/connection_adapters/abstract/connection_specification.rb:34:in block in resolve_string_connection' from /usr/local/rvm/gems/ruby-1.9.3-p194/gems/activerecord->3.2.6/lib/active_record/connection_adapters/abstract/connection_specification.rb:33:infetch'

I'm using ruby-1.9.3-p194 and rails 3.2.6 on Mac OS X Lion 10.7.4.

I've spent the last few days searching the interwebs for a solution. The only progress I made was by downgrading to rails 3.1.6, but then that introduces a bug with saving models.

Any help would be much appreciated.

2

2 Answers

0
votes

I compiled ruby 1.9.3p194 from source but I first had to compile libyaml from source.

Remove/move the defaults files in /usr/bin

sudo mv rails rails-old
sudo mv bundle bundle-old
sudo mv ruby ruby-old
sudo mv gem gem-old

Compile libyaml

cd libyaml-x.x.x
./configure
make
make install

Compile ruby (prefix will tell it where to install during make install and with-opt-dir will tell it where to find libraries such as readline, libyaml etc. Lion should already have them in the directory if you installed xcode)

./configure --prefix=/usr/local --with-opt-dir=/usr/local/lib
make
make install

Install rails

gem install rails