开发者

Rails error 500 on local mac

Ok, I'm a noob with rails... so I just set up rails with RVM and created a new project, and when I try to visit a newly created view I'm getting an error 500.

Heres my setup:

  • OSX 10.6.5
  • Installed MySQL 64bit
  • RVM installed ruby 1.8.7 and rails 2开发者_如何学Python.3.8 (no other rails or ruby except for the system ruby) rvm install 1.8.7, rvm use --create 1.8.7@rails2, gem install rails -v=2.3.8
  • Passenger with Apache gem install passenger, rvmsudo passenger-install-apache2-module
  • Passenger preference pane
  • Turned on websharing

I then proceeded to setup a rails project in my development folder called testapp, added it in the passenger preference pane, and then ran script/generate controller Say, defined an action hello, and then created a view in the app/view/say folder called hello.

Now I'm getting a 500 error when visiting myapp.local/say/hello, what am i doing wrong?


UPDATE:

I checked the logs and also tried running using WEBrick instead of passenger and apache. I got thrown back the same errors. I don't think I should post the entire log, should I? But the first error is

no such file to load -- sqlite3

I have not yet setup a db, I was going to use mysql, but I didn't want to install it since I'm not using models yet. Is it a requirement?


UPDATE 2:

So I installed the mysql gem with gem install mysql -- --include=/usr/local/lib (not sure if this is right). I then created a rails app with rails -d mysql myapp. And set the password in the database.yml. I'm getting a new error now:

Unknown database 'myapp_development'

So I have to create a database. Why am I being forced to create a db at all?


Yeah, you need to install sqlite even if you're not using models yet - Rails checks to make sure whatever is specified in database.yml is actually there to use.


Don't access it through passenger, launch it using ruby script/server and check out the error it throws there. Generally those errors are way more descriptive than Passenger because Passenger is probably running your application using the production environment.


Hey Ryan, do you need to Ruby 1.8.7? Why don't you install the latest 1.9.2 and Rails 3? I have the same environment and so far no problems. Here is a link for installing everything you need. Let me know if it helped! http://amerine.net/2010/02/24/rvm-rails3-ruby-1-9-2-setup.html Salud!

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜