0

I have a rails 3.2.3 application which I was developing on my windows machine using git_bash as cli and mingw32 as environment (installed this env using railsinstaller)and postgres as db. But there were some problems with rmagick and couldn't use it, although minimagick was working as expected.

Now, I am going to move application to my new mac machine running OS X mountain lion. I have installed rails 3.2.8 and ruby on OS X using rvm. what do I need to do to update my application to rails 3.2.8 and setup db and other gems, should I delete or not delete gemfile.lock and what gems I need to remove or add or change version no. etc.

I am new to rails, please help

thanks!

Should I install postgres using homebrew or download from http://www.postgresql.org/download/macosx/ which is a preffered way of installing postgres, pros and cons of these methods.

lightsaber
  • 1,481
  • 18
  • 37

2 Answers2

1

As long as you don't have any Windows/machine-specific code in your app, you'll just need to do bundle install.

Regarding Postgres, it doesn't matter where you get it from, as long as it's on your $PATH. If you're already using Homebrew, then it makes sense to just do brew install postgres.

jmdeldin
  • 5,354
  • 1
  • 28
  • 21
  • Should i delete gemfile.lock or not, as it has a lot of references eg. `bcrypt-ruby (3.0.1-x86-mingw32)` – lightsaber Sep 24 '12 at 07:32
  • @StarWars: I would try `bundle install` and see if it works. Bundler won't install Windows files on your Mac. If it doesn't give you bcrypt, then yes, definitely nuke your Gemfile.lock. Please report back though as it's good info to know about working with Windows! – jmdeldin Sep 24 '12 at 14:44
  • I did a few to things to make it working, and I'm glad that it's working(not checked all the things as I may need to setup few gems related to testing, but running `rails s` works, so I hope everything is okay). I can't write much info in comment. So I'm explaining things that worked for me in my answer. thanks! – lightsaber Sep 25 '12 at 06:30
0

Gemfile.lock gives A list of gems used to ensure that all copies of the app use the same gem versions.

since I'm the only one working on this app and it's not yet in production. So, for me it makes more sense that I nuke Gemfile.lock and specify updated versions of gems I want now.

Things I did

Copied my application directory from my windows machine after cleaning some data in my tmp/ directory( tmp/ directory had 100M of data).

Installed imagemagick using brew install imagemagick

Installed postgresql using brew install postgresql

Generated a sample app using rails new blog -d postgresql Changed database.yml file according to postgresql, as it required my mac user to be the username. run sample blog app, and it was working fine. created a scaffolding and entered data and everything was working.

copied content of Gemfile.lock from blog application and pasted in my application's Gemfile.lock

changed version of rails in my Gemfile from 3.2.3 to latest version 3.2.8. changed version of some other gems.Replaced 'minimagick' with 'rmagick'. (I had problem with installing rmagick gem on windows, minimagick gem somehow worked on windows with older version of imagemagick). Changed database.yml.

run rake db:create:all to create all the db.

run rake db:migrate

Run bundle and it installed all the dependecies.

run rails s

Everything is working fine now :)

lightsaber
  • 1,481
  • 18
  • 37