我想在服务器上安装mysql2.所以我的第一个不幸的踪迹如下
gem install mysql2
Run Code Online (Sandbox Code Playgroud)
输出
Building native extensions. This could take a while...
ERROR: Error installing mysql2:
ERROR: Failed to build gem native extension.
/usr/bin/ruby1.8 extconf.rb
checking for rb_thread_blocking_region()... no
checking for rb_wait_for_single_fd()... no
checking for mysql_query() in -lmysqlclient... no
checking for main() in -lm... yes
checking for mysql_query() in -lmysqlclient... no
checking for main() in -lz... yes
checking for mysql_query() in -lmysqlclient... no
checking for main() in -lsocket... no
checking for mysql_query() in -lmysqlclient... no
checking for main() in …
Run Code Online (Sandbox Code Playgroud) 我正在使用乘客和capistrano部署我的第一个rails应用程序.
在我尝试在浏览器中启动应用程序时遇到此错误,一切都很好.
Error message:
uninitialized constant CarrierWave
Exception class:
NameError
Run Code Online (Sandbox Code Playgroud)
您可以在http://test.ajhezaty.com/上查看详细信息.
该网站在本地完美运行,CarrierWave正确上传图像.
我试图通过运行重启VPS服务器
sudo /etc/init.d/httpd2 restart
Run Code Online (Sandbox Code Playgroud)
但它没有解决这个问题.
为您的信息安装在服务器上的gem
$ gem list | grep carrierwave
carrierwave (0.6.1)
Run Code Online (Sandbox Code Playgroud) 在将mysite部署到VPS后,我遇到了这个运行时错误.请注意,在我的本地机器上,每件事都运行正常.
当我尝试通过控制器路径访问任何视图时,请说PostsController #index
我收到了这个错误
Completed 500 Internal Server Error in 3ms
ActionView::MissingTemplate (Missing template posts/index, application/index with {:handlers=>[:builder, :erb], :formats=>[:html], :locale=>[:en]}. Searched in:
"/home//dev..com/releases/20120413023845/app/views"
):
app/controllers/posts_controller.rb:7:in `index'
Run Code Online (Sandbox Code Playgroud)
我认为haml是问题的原因,但我还不确定.
我添加了haml宝石并捆绑了我的应用程序
gem 'haml'
gem 'haml-rails'
Run Code Online (Sandbox Code Playgroud)
更新:
当我将index.html.haml更改为index.html.erb并评论其工作的模板内容时,它忽略了application.html.haml布局而没有错误.
我注意到当cap命令运行时,应用程序没有编译我的hamls
RAILS_ENV=production RAILS_GROUPS=assets assets:precompile
Compiled application.js (1ms) (pid 15420)
Compiled application.css (1ms) (pid 15420)
Compiled application.js (1ms) (pid 15420)
Compiled application.css (1ms) (pid 15420)
Run Code Online (Sandbox Code Playgroud)
这是否意味着我有资产管道管理的haml转换器的问题?如何告诉rails在生产环境中处理haml.
这是我的生产宝石版本
Using rake (0.9.2.2)
Using i18n (0.6.0)
Using multi_json (1.2.0)
Using activesupport (3.2.3)
Using builder (3.0.0)
Using activemodel (3.2.3)
Using …
Run Code Online (Sandbox Code Playgroud)