Go to the mysql console and follow these steps
> use mysql;
> update user set password=PASSWORD("mynewpassword") where User='root';
> flush privileges;
> quit
Go to the mysql console and follow these steps
> use mysql;
> update user set password=PASSWORD("mynewpassword") where User='root';
> flush privileges;
> quit
I got this error while working with paperclip. The project was stable and I have no idea why this error happens at this point of time.
[paperclip] An error was received while processing: # [paperclip] An error was received while processing: #<Paperclip::PaperclipError: There was an error processing the thumbnail for paperclip-reprocess20110822-2281-19969sz
So I was lazy to fix the error, and find that I have no imagemagick installed in my new system. After installing ‘imagemagick’ it got fixed.
$ sudo apt-get update $ sudo apt-get install imagemagick --fix-missing
Suppose we have a map-icon.png file under assets/map/ folder and we need to find the path for the precompiled version of this image.
You can find the path and display it in the view by using this:
= "/assets/#{Rails.application.assets.find_asset('new-map/map-gt3.png').digest_path}"
Use the following command
$ yum install redis OR $ yum install redis php-pecl-redis
Start the redis service
$ service redis start
Install image magick by the following command
$ yum install ImageMagick ImageMagick-perl
The above command will install ImageMagick and its dependencies automatically.
Upgrade Packages
yum update
Installing Recommended Packages
yum install gcc-c++ patch readline readline-devel zlib zlib-devel yum install libyaml-devel libffi-devel openssl-devel make yum install bzip2 autoconf automake libtool bison iconv-devel
Install RVM ( Ruby Version Manager )
$ curl -L get.rvm.io | bash -s stable
Install Required Ruby Version
$ rvm install 1.9.3
Install rails
$ gem install rails --version '3.2.19'
Check ruby is already installed in your system or not
$ ruby -v
Install curl if not installed
$ sudo apt-get install curl
Check curl version by
$ curl --version
Install RVM
Execute the command in the terminal
$ curl -L https://get.rvm.io | bash -s stable
If the installation is done, close the terminal window and open it again to load the rvm into the shell
Check rvm version
$ rvm -v rvm 1.25.30 (stable) by Wayne E. Seguin , Michal Papis [https://rvm.io/]
List rvm known rubies
$ rvm list known
Use rvm to install ruby 1.9.3
$ rvm install 1.9.3
Check the ruby versions available
$ rvm list rubies
Check the ruby version by
$ ruby -v
If this again shows the message to install ruby, then set this ruby version as default
$ rvm use ruby-1.9.3-p547 --default
then check ruby -v
Make gem package up to date
$ gem update
Install Rails 3.2.19
$ gem install rails --version '3.2.19'
Check rails version
$ rails -v
You are ready to go!
I got this error after my thinking sphinx updation to the newest version of ‘3.0.5’. The error shows in the exact line of the code Model.search in my Rails controller. I updated my mysql2 version to ‘0.3.13’, and the issue is solved.
So in you Gemfile update the mysql2 version:
gem 'mysql2', '0.3.13'
And do
$ bundle install
Get the stable version of rvm:
$ rvm get stable
Install Ruby 2.0
$ rvm install ruby-2.0.0
Create a Gemset;
$ rvm gemset create rails-4.0
Goto that gemset:
$ rvm use ruby-2.0.0-p247@rails-4.0
Install Rails 4.0
$ gem install rails --version=4.0
Create an rvmrc file in root folder:
$ vim rvmrc $ rvm --rvmrc use ruby-2.0.0-p247@rails-4.0
uncomment the line gem ‘therubyracer’, platforms: :ruby from Gemfile
Start the server:
$ rails s
You are ready to go!!
Changes that you may need to perform while working with Rails 4 compared to old versions:
1. Check here for the New changes in Rails 4
http://net.tutsplus.com/tutorials/ruby/digging-into-rails-4/
http://www.alfajango.com/blog/rails-4-whats-new/
http://www.sitepoint.com/get-your-app-ready-for-rails-4/
2. If you are using devise gem use devise version 3 or above (http://blog.plataformatec.com.br/2013/05/devise-and-rails-4/)
Even if we are specified the database configuration for adapter in our database.yml, sometimes we are getting the error “database configuration does not specify adapter”. Usually you are doing the command for development
$ rake assets:precompile -t
And in your database.yml, configuration for development is specified. But if you are doing
$ rake assets:precompile -t RAILS_ENV=development
then you can see the error goes.
Another way is check your database.yml for production database configuration is there or not. If you adds the production database configuration then also it works! Because while doing the precompile for assets without specifying the environment then it checks all environments db configuration.
Another way is add the following in your application.rb file
config.assets.initialize_on_precompile = false
then also it works.