This forum is no longer active. Please post your questions to our new community site

RubyStack problems with Mac OS X Snow Leopard

Subscribe to RubyStack problems with Mac OS X Snow Leopard 7 post(s), 4 voice(s)

 
Avatar Tom B 3 post(s)

I installed RubyStack today on Snow Leopard. Then I did a cd /Applications/rubystack-2.0-1/projects/rubystack, and launched rails via ruby script/server

I then tried to follow the recommendations on the Welcome Aboard page. script/generate fails as follows:

Rails requires RubyGems >= 1.3.2 (you have 1.3.1). Please `gem update —system` and try again.

However, this is a reference to the Apple Ruby install, as the Bitnami package has installed RubyGems 1.3.5

The pwd command indicates that I’m still in the Bitnami-installed directory, so why is it going to the Apple location.

gem update —system fails similarly, as it runs from /usr/local/bin.

So, why do the items I installed through Bitnami’s RubyStack escape to run from /usr/local/bin when I try to use them?

Do I have to make some PATH change that isn’t mentioned in the Bitnami document?

Thanks,
Tom

 
Avatar Beltrán Rueda Administrator 3,714 post(s)

Hi,

BitNami RubyStack is self-contained and independent of your system. You should load the Stack environment before running a Ruby command. For example, if you open a Terminal and execute “which ruby” you can see that you are running the system Ruby command. To load the environment variables you should run the “rubyconsole” before running any command:

$ cd /Applications/rubystack-
$ ./rubyconsole
$ which ruby

Now you can see that you are running the Ruby Stack command. Now try to start the servers and everything should run well.

 
Avatar Tom B 3 post(s)

Thanks. Your advice got me past this problem.

Tom

 
Avatar Tom B 3 post(s)

Now I have a new problem trying to use an existing Rails app in the RubyStack environment on Mac OS X (Snow Leopard). When I try to access the app at http://localhost:3000 or at http://127.0.0.1:3000/ I get an error from MySQL:

bash-3.2$ => Booting Mongrel
=> Rails 2.3.5 application starting on http://0.0.0.0:3000
=> Call with -d to detach
=> Ctrl-C to shutdown server

bash-3.2$ /!\ FAILSAFE /!\ Mon Jan 04 21:29:38 -0500 2010
Status: 500 Internal Server Error
Access denied for user ’rubystack’@’localhost’ (using password: YES)
/Applications/rubystack-2.0-1/ruby/lib/ruby/gems/1.8/gems/activerecord-2.3.5/lib/active_record/connection_adapters/mysql_adapter.rb:589:in `real_connect’
… which is then followed by a pile of errors that result from this.

The app I’m running is /Applications/rubystack-2.0-1/projects/expenses

The relevant part of /Applications/rubystack-2.0-1/projects/expenses/config/database.yml is:

adapter: mysql database: expenses_development timeout: 5000 username: rubystack password: babush socket: /Applications/rubystack-2.0-1/mysql/tmp/mysql.sock

When I try to run

rake db:migrate

I get the same "Access denied " error: Access denied for user ’rubystack’@’localhost’ to database ‘expenses_development’

This is all the information I can find in any of the logs, except for the cascade of subsequent errors in each case. At this point, I am stumped. I would appreciate any advice.

Thanks,
Tom

 
Avatar carlos Administrator 144 post(s)

Hi Tom,

The connection error can be related to different things:

Is the database running ? You can check this using:

/Applications/rubystack-2.0-1/ctlscript.sh status
If not start it using
/Applications/rubystack-2.0-1/ctlscript.sh start mysql

Did you create the rubystack user? You can check if it exists connecting to MySQL as ‘root’ with the password provided during installation:

/Applications/rubystack-2.0-1/mysql/bin/mysql -u root -ppasswdduringinstallation -S /Applications/rubystack-2.0-1/mysql/tmp/mysql.sock -e "select user from mysql.user;"
Was the database expenses_development created ? It should be listed if you run
/Applications/rubystack-2.0-1/mysql/bin/mysql -u root -ppasswdduringinstallation -S /Applications/rubystack-2.0-1/mysql/tmp/mysql.sock -e "show databases;"

If both are there, check if you are able to connect using that username
/Applications/rubystack-2.0-1/mysql/bin/mysql -u rubystack -pbabush -S /Applications/rubystack-2.0-1/mysql/tmp/mysql.sock expenses_development

If not you may create both the database and the user with appropriate privileges running:

/Applications/rubystack-2.0-1/mysql/bin/mysql -u root -ppasswdduringinstallation -S /Applications/rubystack-2.0-1/mysql/tmp/mysql.sock -e "CREATE DATABASE IF NOT EXISTS expenses_development;GRANT ALL PRIVILEGES on expenses_development.* to 'rubystack'@'localhost' IDENTIFIED BY 'babush';FLUSH PRIVILEGES;"

Let us know if it works for you

 
Avatar ozone 16 post(s)

hello i have a problem with the paperclip and rmagick. Where i can find a tutorial for the correct way to do this. i have and application that i have tested on my linux machine without bitnami and works very fine. now i am in a mac machine with bitnami and a i can’t upload images. please help me

 
Avatar Beltrán Rueda Administrator 3,714 post(s)

Hi, Could you post the error which is in the mongrel.log file?