Ruby on rails 将项目部署到Dreamhost

Ruby on rails 将项目部署到Dreamhost,ruby-on-rails,ruby,dreamhost,chiliproject,Ruby On Rails,Ruby,Dreamhost,Chiliproject,在部署时遇到一些问题。我已经试过两次了。以下是我到目前为止所做的 已在上安装所需的gems和版本: 下载该软件包: git clone git://github.com/chiliproject/chiliproject.git cd chiliproject git checkout stable 必须找到并设置捆绑包,因为它不在我的路径中: BUNDLE="/usr/lib/ruby/gems/1.8/bin/bundle" 将我的数据库信息放入database.yml: 然后开始打包东

在部署时遇到一些问题。我已经试过两次了。以下是我到目前为止所做的

已在上安装所需的gems和版本:

下载该软件包:

git clone git://github.com/chiliproject/chiliproject.git
cd chiliproject
git checkout stable
必须找到并设置捆绑包,因为它不在我的路径中:

BUNDLE="/usr/lib/ruby/gems/1.8/bin/bundle"
将我的数据库信息放入database.yml:

然后开始打包东西:

$BUNDLE install --without=postgres rmagick
$BUNDLE exec rake generate_session_store
最后一个命令出现错误:

rake aborted!
can't activate rails (= 2.3.5, runtime), already activated rails-2.3.12. Make sure all dependencies are added to Gemfile.
因此,我将GEM文件中的2.3.12更改为2.3.5,并继续:

RAIL_ENV=production $BUNDLE exec rake db:migrate
然后我在这个命令上也出现了一个错误:

** Invoke db:migrate (first_time)
** Invoke environment (first_time)
** Execute environment
rake aborted!
undefined method `autoload_paths' for #<Rails::Configuration:0x68a68dbb82c0>
/home/USERNAME/DOMAIN/public/config/environment.rb:44
然而,最后一个命令却失败了,它说mysql“user”的权限被拒绝@“173.236.128.0/255.255.128.0”,我想WTF会像主机一样尝试连接到网络吗

所以我继续,在中复制了我的配置文件和环境文件。更改/添加了以下行:

# Uncomment below to force Rails into production mode when
# you don't control web/app server and can't set it the proper way
 ENV['RAILS_ENV'] ||= 'production'

# Specifies gem version of Rails to use when vendor/rails is not present
RAILS_GEM_VERSION = '2.3.5'# unless defined? RAILS_GEM_VERSION

if ENV['RAILS_ENV'] == 'production'  # don't bother on dev
  ENV['GEM_PATH'] = '/home/USERNAME/.gems' + ':/usr/lib/ruby/gems/1.8'
end
然后使这些内容可写并重新启动:

chmod -R 777 files log tmp public/plugin_assets/
touch tmp/restart.txt
对不起,这是一堵文字墙,有人能看出我做错了什么吗

提前谢谢

编辑:所以这一切都错了,下面是我如何让它工作的

rm ~/.gem*
gem install bundler

PATH=$PATH:/usr/lib/ruby/gems/1.8/bin

cd ~
git clone git://github.com/chiliproject/chiliproject.git
cd chiliproject
git checkout stable

cp * ../example.com/ -R
cd ../example.com

# Make sure database is working

bundle install --without postgres rmagick test
bundle exec rake generate_session_store

RAILS_ENV=production bundle exec rake db:migrate

# No output is no good, check database.yml

RAILS_ENV=production bundle exec rake redmine:load_default_data

或者,请参阅以下内容:

不要将
gem install
命令与bundler包管理混淆。这样做会得到意想不到的结果

如果你真的想使用bundler-将你想要的所有宝石添加到一个文件夹中。 否则就忽略它


快速搜索“bundler项目”使我找到。显然,它已经被合并到不稳定的版本中。

当前的ChiliProject稳定版本(2.x)需要使用bundler。因此,斯洛托斯的回答在这里是不正确的。gen安装不再有效,我们需要bundler

另外,我们现在需要Rails 2.3.12。如果您随意编辑文件,将不会得到任何工作结果。在某些平台上,您需要调整(例如,在使用Ruby 1.8.6或ImageMagick的某些版本时)。对于目前建议使用Ruby 1.8.7或REE的设置,您不需要修改任何内容

要安装当前稳定的ChiliProject 2.x版本的依赖项,基本上需要执行以下操作:

首先,您需要确保gem二进制文件重新安装到的目录位于
$PATH
中。这可以通过运行(在您的情况下)暂时实现

然后您需要安装bundler gem并指示它安装所有依赖项

gem install bundler
bundle install --without rmagick postgres test # in your case

在您的例子中,真正奇怪的是rake似乎试图启用Rails 2.3.5。它不应该这样做(除非您更改了某些文件,否则不会这样做)。我强烈建议从新的干净源代码树开始,不要更改任何任意文件。

谢谢,谢谢,我放弃了gem安装,开始只使用bundler。。。乘客说它找不到宝石。。。不用测试就可以了,谢谢你。我遇到一个乘客错误,说它找不到宝石,但没有说是哪颗。我执行了你说的命令,它开始工作了耶!以下是我使用的命令列表,再次感谢:)
rm ~/.gem*
gem install bundler

PATH=$PATH:/usr/lib/ruby/gems/1.8/bin

cd ~
git clone git://github.com/chiliproject/chiliproject.git
cd chiliproject
git checkout stable

cp * ../example.com/ -R
cd ../example.com

# Make sure database is working

bundle install --without postgres rmagick test
bundle exec rake generate_session_store

RAILS_ENV=production bundle exec rake db:migrate

# No output is no good, check database.yml

RAILS_ENV=production bundle exec rake redmine:load_default_data
export PATH=/usr/lib/ruby/gems/1.8/bin:$PATH
gem install bundler
bundle install --without rmagick postgres test # in your case