Can't install RMagick 0.0.0. Can't find MagickWand.h.

ลง imagemagick (32 bits) จาก

*** ตอนลง imagemagick ห้ามมีช่องว่าง ***

จากนั้น set path ให้ windows

เมื่อ gem install ใส่ option ด้วย เป็น path ของ imagemagick

gem install rmagick -- '--with-opt-dir="[path to ImageMagick]"'

gem install rmagick -- '--with-opt-dir="C:\ImageMagick"'

Using MySQL with Rails 3 on Windows

gem mysql2 ไม่ support mysql 64 bits ???

ลง mysql connector 32 bits

แล้วก็ ...

    gem install mysql2 -- '--with-mysql-lib="C:\Program Files (x86)\MySQL\MySQL Connector C 6.1\lib" --with-mysql-include="C:\Program Files (x86)\MySQL\MySQL Connector C 6.1\include"

แล้วก็ ...

copy libmysql.dll จาก C:\Program Files (x86)\MySQL\MySQL Connector C 6.1\lib ไปไว้ที่ C:\Ruby193\bin นะจ๊ะ

Using MySQL with Rails 3 on Windows

    Install railsinstaller -> (I installed it to c:\Rails)

    Install MySQL (I used MySQL 5.5) ->

    --- for mySQL installation ---

    If you dont already have these two files installed you might need them to get your MySQL going

    vcredist_x86.exe -> dotNetFx40_Full_x86_x64.exe ->

    Use default install Developer Machine

    -MySQL Server Config-
    port: 3306
    windows service name: MySQL55
    mysql root pass: root (you can change this later)
    (username: root)
    -MySQL Server Config-

    --- for mySQL installation ---

    --- Install the mysql2 Gem ---

    Important: Do this with Git Bash Command Line(this was installed with railsinstaller) -> start/Git Bash

    gem install mysql2 -- '--with-mysql-lib="c:\Program Files\MySQL\MySQL Server 5.5\lib" --with-mysql-include="c:\Program Files\MySQL\MySQL Server 5.5\include"'

    Now the gem should have installed correctly

    Lastly copy the libmysql.dll file from
    C:\Program Files\MySQL\MySQL Server 5.5\lib

    --- Install the mysql2 Gem ---

bundle install --deployment

หาก Gemfile ใช้ gem ที่ยังไม่ใช่ .gem เช่น


gem 'prawn', git: '', branch: 'master'

*** อย่าลืมลง git ด้วย ถ้า source เป็น git

bundle install ก็ผ่านปกติ แต่...

Error message: (at master) is not checked out. Please run `bundle install` (Bundler::GitError)


bundle install --deployment

Rails 4.1.0 - Nginx Bad Gateway with Passenger

I'm writing a little issue tracking application, and as it's a new app I'm using the new shiny Rails 4.1.0. However, whilst the application runs fine locally using Webrick I've been unable to get it working when deployed onto a live (staging) environment running Passenger and Nginx (using the Ubuntu package available via the Phusion Passenger site).

When deployed and configured, Nginx reports a 502 Bad Gateway exception. Digging throught the Nginx error log (in /var/log/nginx), the error becomes clear:

Exception RuntimeError in Rack application object (Missing secret_key_base for 'production' environment, set this value in config/secrets.yml)

Opening secrets.yml shows that there is no value for production:

  secret_key_base: **not_for_prying_eyes**

  secret_key_base: **not_for_prying_eyes**

# Do not keep production secrets in the repository,
# instead read values from the environment.
  secret_key_base: <%= ENV["SECRET_KEY_BASE"] %>

You can either set an environment variable, or directly configure a value here (you can run rake secret to generate a key). Just make sure that if you do the latter, you've added secrets/yml to your .gitignore!