I deployed my first rails app to a production server a few days ago. Since then, I've been working on some fixes on my development machine and I pushed those over to the production server via git. I touched the restart.txt
file and then restarted Apache, and now I'm getting a Passenger error that I think is related to gems and bundle.
When I first started development I ran into an issue (here) and I removed the .bundle
directory. I then ran bundle install
again on my development machine, and all seemed well while I fixed some bugs.
Now I'm ready to redeploy the next version of the app, and after these errors, I checked and noticed that I don't even have a .bundle
directory anymore. bundle install
doesn't create a new one. I assume nothing's going to work without that? Should I just manually create the requisite files or is there a command to regenerate those?
EDIT to add error: syntax error on line 3, col 2: adapter:sqli开发者_开发技巧te3'
database.yml
:
# SQLite version 3.x
gem install sqlite3
development:
adapter: sqlite3
database: db/development.sqlite3
pool: 5
timeout: 5000
# 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: sqlite3
database: db/test.sqlite3
pool: 5
timeout: 5000
production:
adapter: sqlite3
database: db/production.sqlite3
pool: 5
timeout: 5000
Is the gem install sqlite3
in your listing of database.yml
actually present in that file? If that is the case than that is the cause of the error as it is invalid YAML. Also, the statement doesn't make sense here, as the file isn't interpreted by neither bundler nor ruby.
At best, just remove (or comment) that statement there and try gain.
Edit: Generally, whitespace (especially leading whitespace) is rather important in YAML. Don't mix spaces and tabs here. It would confuse the parser. Also there need to be a space between the key and the value in a hash like so
key: value
# ^ this space is important!
Please refer to YAML's Wikipedia article for more info about YAML syntax.
@Paul, can you try updating your gemfile as follows
group :production do
# gem 'mysql2' # disabled to debug Paul's issue.
gem 'sqlite3-ruby', :require => 'sqlite3'
end
group :development do
gem 'sqlite3-ruby', :require => 'sqlite3'
end
Let me know how this pans out.
精彩评论