I’m new in Rails and I’m getting some problems.
About system: Rails-3.2.1 Ruby-1.8.7 RedHat
Everything works well in local system. The problem occurs on web host.
I’m trying to configure the system, but the information given isnt good enough.
I’m using mysql (mysql2 gem) and the database.yml is configured properly (I guess).
database.yml
# MySQL. Versions 4.1 and 5.0 are recommended.
#
# Install the MYSQL driver
# gem install mysql2
#
# Ensure the MySQL gem is defined in your Gemfile
# gem 'mysql2'
#
# And be sure to use new-style password hashing:
# http://dev.mysql.com/doc/refman/5.0/en/old-client.html
development:
adapter: mysql2
encoding: utf8
reconnect: false
database: rffaguiar
pool: 5
username: rffaguiar
password: ******
host: mysql01.rffaguiar.com.br
# Warning: The database defined as "test" will be erased and
# re-generated from your development database when you run "rake".
# Do not set this db to the same as development or production.
test:
adapter: mysql2
encoding: utf8
reconnect: false
database: rffaguiar
pool: 5
username: rffaguiar
password: ******
host: mysql01.rffaguiar.com.br
production:
adapter: mysql2
encoding: utf8
reconnect: false
database: rffaguiar
pool: 5
username: rffaguiar
password: ******
host: mysql01.rffaguiar.com.br
bundle command
/home/storage/3/d2/f5/rffaguiar/rails_apps/teste_pos$ bundle
Using rake (0.9.2.2)
Using i18n (0.6.0)
Using multi_json (1.0.4)
Using activesupport (3.2.1)
Using builder (3.0.0)
Using activemodel (3.2.1)
Using erubis (2.7.0)
Using journey (1.0.1)
Using rack (1.4.1)
Using rack-cache (1.1)
Using rack-test (0.6.1)
Using hike (1.2.1)
Using tilt (1.3.3)
Using sprockets (2.1.2)
Using actionpack (3.2.1)
Using mime-types (1.17.2)
Using polyglot (0.3.3)
Using treetop (1.4.10)
Using mail (2.4.1)
Using actionmailer (3.2.1)
Using arel (3.0.0)
Using tzinfo (0.3.31)
Using activerecord (3.2.1)
Using activeresource (3.2.1)
Using bundler (1.0.21)
Using coffee-script-source (1.2.0)
Using execjs (1.3.0)
Using coffee-script (2.2.0)
Using rack-ssl (1.3.2)
Using json (1.6.5)
Using rdoc (3.12)
Using thor (0.14.6)
Using railties (3.2.1)
Using coffee-rails (3.2.2)
Using johnson (1.2.0)
Using jquery-rails (2.0.0)
Using mysql (2.8.1)
Using mysql2 (0.3.11)
Using rails (3.2.1)
Using sass (3.1.14)
Using sass-rails (3.2.4)
Using uglifier (1.2.3)
[32mYour bundle is complete! Use `bundle show [gemname]` to see where a bundled gem is installed.[0m
The test app has only 1 controller(hello), 1 view(index) and 1 model.
When the root is that default rails html page, it’s ok, but when I modify the root to ‘hello#index’, I get 500 error page.
I don’t know if theres something related, but when using ‘rake test’ i get this:
Can’t connect to local MySQL server through socket
‘/var/lib/mysql/mysql.sock’
But there’s no mysql.sock there.
I’ve been searching for a couple hours about these problems without success.
Can anyone point me to the right direction? Sorry if theres something wrong, this is my first question here.
Update 1:
netstat -ln | grep mysql
Returns nothing.
Update 2:
Now, I’m getting a passenger error page:
Could not find rake-0.9.2.2 in any of the sources
(Bundler::GemNotFound)
But the gem is on Gemfile.This is the link provided by my webhost to configure the test. Forget the portuguese, look at the code, =). There, you can see IP on host line, and not a hostname like I’m doing, but they say to use hostname because DB IP can change. Yes, I’m trying all the tests using both.
About the socket line: I used it only when I got the mysql error before. Now I removed it.
About passenger: I’m doing the tests after restarting passenger with restart.txt
Thanks for help, but the webhost answered me after days and days disturbing them.
They say (a brief summary):
I don’t even need to say that I’ll change webhost. They have a tutorial for rails 3.2.1 and it doesnt work. This is insane, worried me for 3 days. My webhost was Locaweb (BR).
Again, thank you for the help.