After upgrading to Rails 3.0 Library rmagick longer be detected. Here is my setup:
Ubuntu server 10.4
gem 1.7.2
ruby 1.9.1
rails 3.0.7
rmagick-2.13.1
In irb can include library:
irb(main):002:0> require 'RMagick'
=> true
In rails 2 rmagick is available.
add
gem 'RMagick'
or
gem "rmagick", "~> 2.13.1"
to your Gemfile and then run
bundle
install
apt-get install libmagick9-dev
first
For those using Heroku:
gem "rmagick", "~>2.13.2", :require => 'RMagick'
Also, include the following wherever you're using it:
require 'RMagick'
For anyone reading this now, I was having issues installing libmagick9-dev(it appears to have been replaced).
I ran the following and it installed successfully:
sudo apt-get install libmagickcore-dev
sudo apt-get install graphicsmagick-libmagick-dev-compat
sudo apt-get install libmagickwand-dev
sudo apt-get install imagemagick
gem install rmagick
Cheers
When running bundle for an application like Redmine, gem might be optional, so you must include it like:
bundle install --with rmagick
Considering that it exists in your Gemfile, it should look something
like:
group :rmagick do
gem "rmagick", "~> 2.16.0"
end
Related
bundler (2.0.1, default: 1.17.2)
How could I change the default to 2.0.1
Following https://bundler.io/guides/bundler_2_upgrade.html#upgrading-applications-from-bundler-1-to-bundler-2, here's what worked for me:
gem install --default bundler
gem update --system
bundle update --bundler
What helped me is to delete the current default manually from the folder
lib\ruby\gems\2.6.0\specifications\default\
and then install fresh bundler as usually
gem install bundler
or as default
gem install --default bundler
I had this same concern when trying to setup Bundler gem 2.2.11 as the default gem on my machine.
Here's how I achieved it:
First, I listed and uninstalled all other versions of the Bundler gem because I did not need them:
gem list bundler
gem uninstall bundler
If you encounter an error like this
Gem bundler-2.1.4 cannot be uninstalled because it is a default gem
Simply run the command below to get your ruby installation directory:
gem environment | grep "INSTALLATION DIRECTORY"
This should display an output like this. In my case my ruby version was 2.7.2:
- INSTALLATION DIRECTORY: /home/mycomputer/.rbenv/versions/2.7.2/lib/ruby/gems/2.7.0
Next, navigate to the specifications/default directory of the INSTALLATION PATH:
cd /home/mycomputer/.rbenv/versions/2.7.2/lib/ruby/gems/2.7.0/specifications/default
Remove/delete the bundler.gemspec file that you have there. In my case it was bundler-2.1.4.gemspec, so I ran the command:
rm bundler-2.1.4.gemspec
Next, I installed the Bundler gem 2.2.11 and made it the default gem:
gem install --default bundler -v 2.2.11
Next, I listed my Bundler versions:
gem list bundler
Finally, I updated my gems to use the newly installed Bundler:
gem update --system
That's all.
I hope this helps
You need to remove .spec file to remove the gem.
Steps:
gem env – try to search in provided list under GEM PATHS, in specifications/default
remove there bundler-VERSION.gemspec
install bundler, if you don't have specific: gem install bundler:VERSION --default
gem install --default bundler:<version>
You need to know where the default specs are, so use gem environment to find out.
the steps I used were:
gem environment
# note INSTALLATION DIRECTORY
cd <installation_dir>
cd specifications/default
rm bundler-2.1.4.gemspec
gem install --default bundler -v 2.2.11
Remove all default bundler versions.
Commands:
$ gem environment
$ cd INSTALLATION DIRECTORY
$ cd specifications
$ cd default
$ rm bundler version
$ gem install bundler
I git cloned a repo. I cannot run it on localhost with rails server because terminal says
Could not find activesupport-4.2.5 in any of the sources Run bundle
install to install missing gems.
When I run bundle install, I get
An error occurred while installing pg (0.18.4), and Bundler cannot
continue. Make sure that gem install pg -v '0.18.4' succeeds before
bundling.
I have rails 4.2.3, and the repo's Gemfile has gem 'rails', '4.2.5'. I don't know if this matter
Gem pg is Postgres driver, it only can be installed, if corresponding headers and libraries are present and can be accessed.
Most probably just installing postgres will fix it. If you're on a Mac with homebrew - brew install postgresql
Install postgresql.
Remove Gemfile.lock
Add gem 'pg' in your gemfile
execute bundle install
1: Remove Gemfile.lock if Gemgile.lock present in your project
2: add gem 'pg' # in Gemfile
3: Run bundle install
Hope this help you !!!
Run
sudo env ARCHFLAGS="-arch x86_64" gem install pg -v '1.18.4'
Now try running bundle install again.
I used a combination of #Chakreshwar Sharma and #Vinay's answers to get this working for the metasploit-framework.
Remove Gemfile.lock
Add gem 'pg' in your gemfile
Run apt-cache search postgresql-server-dev
apt-get update && apt-get install postgresql-server-dev-9.5 # Check your version
bundle install --no-deployment
To be honest, I think you could just run:
apt-cache search postgresql-server-dev
apt-cache search postgresql-server-dev-9.5
bundle install
...and you can avoid messing with the Gemfile, but I didn't get to verify it since mine started working after I made the adjustments.
I know there are bunch of question or similar on the web, but it doesn't fit my case.
I'm installing redmine, and when I call bundle install, I get this error :
[!] There was an error parsing `Gemfile`: compile error - syntax error, unexpected ':', expecting $end
gem 'tzinfo-data', platforms: [:mingw, :x64_mingw, :mswin, :jruby]
^. Bundler cannot continue.
The error is on this line (the one prefixed by ->):
source 'https://rubygems.org'
if Gem::Version.new(Bundler::VERSION) < Gem::Version.new('1.5.0')
abort "Redmine requires Bundler 1.5.0 or higher (you're using #{Bundler::VERSION}).\nPlease update with 'gem update bundler'."
end
gem "rails", "4.2.3"
gem "jquery-rails", "~> 3.1.3"
gem "coderay", "~> 1.1.0"
gem "builder", ">= 3.0.4"
gem "request_store", "1.0.5"
gem "mime-types"
gem "protected_attributes"
gem "actionpack-action_caching"
gem "actionpack-xml_parser"
gem "loofah", "~> 2.0"
# Windows does not include zoneinfo files, so bundle the tzinfo-data gem
-> gem 'tzinfo-data', platforms: [:mingw, :x64_mingw, :mswin, :jruby]
gem "rbpdf", "~> 1.18.6"
# Optional gem for LDAP authentication
group :ldap do
gem "net-ldap", "~> 0.3.1"
end
like it's said in so many other threads, a cause could be that this code use the "new" ruby 1.9 hash syntax. However, looking at the versions:
$ ruby -v
ruby 2.1.5p273 (2014-11-13) [x86_64-linux-gnu]
$ gem -v
2.2.2
$ bundle -v
Bundler version 1.10.6
$ bundle exec ruby -v
ruby 2.1.5p273 (2014-11-13) [x86_64-linux-gnu]
$ which bundler
/usr/local/bin/bundler
EDIT: as suggested by Arsen, this command shows where is the problem, I'll read some documentations about ruby and virtual environments to get it work the right way :
$ bundle env
Environment
Bundler 1.10.6
Rubygems 1.8.24
Ruby 1.8.7 (2012-02-08 patchlevel 358) [x86_64-linux]
Git 2.5.1
Bundler settings
without
Set for your local app (/home/leo/http/redmine.leo-flaventin.com/redmine/.bundle/config): "development:test"
Gemfile
[...] #The redmine Gemfile
Then, I think gem is using ruby 2.2 (but I'm not sure) so I think there shouldn't be any problem, but since I don't really know the ruby universe and there is actually an error, I'm certainly wrong. That's why I request the help of the community...
So any ideas of what is going on ?
(I could correct the file using the old hash syntax, but since I would like to use the latest versions, I think that would only move the problem)
This is a old question but since it is unsolved and I ran into the same problem I'll share my solution.
I installed ruby via apt-get on my debian 7 server. When trying to run bundle install I got the same error message as above:
[!] There was an error parsing Gemfile: compile error - syntax
error, unexpected ':', expecting $end
My soultion was to install ruby via ruby version manager.
Remove ruby sudo apt-get remove ruby && sudo apt-get autoremove
Install ruby via ruby version manager (rvm) \curl -sSL https://get.rvm.io | sudo bash -s stable --rails
If 2. fails, add signature (as prompted) \curl -sSL https://get.rvm.io | sudo bash -s stable --rails
Add user to group sudo usermod -aG rvm USERNAME && sudo usermod -aG rvm www-data
Logout & login
Re-run your bundle install command
If you still have problems they should be application relevant. For me I additionally had to install sudo apt-get install libmysqlclient-dev.
I've seen this solution while following a tutorial on this blog
Try to add ruby "2.1.5" to Gemfile
Or just use rbenv
this worked for me when I got the same error installing a new app with rails 5:
gem install rails --version=5.0.0.1
bundle install
I do not know why it worked.
I have installed rails and am running Git Bash and am on Windows 7 64 bit, i have installed gemfile and updated and this is my first use of ruby! I am following the instrustions from devise's github: https://github.com/plataformatec/devise . I am probably being very stupid but when i run gem 'devise' and this error occurs:
ERROR: while executing gem... <Gem::commandlinerror> unknown command /devise
Any help would be greatly appreciated
i think you are not installing gem properly.
gem install command is gem install devise
or perhaps you should add the gem to your Gemfile like this
gem "devise"
and then run this command in your terminal
bundle install
If you are running gem 'devise' then it won't work because its not a valid command.
You should give
gem install devise
or
Include gem 'devise' in Gemfile and run bundle install
Hi I am using rails 3 and ruby 1.9.3 and i am trying to install dynamic-spree-sitemaps with following code
script/extension install git://github.com/polomasta/dynamic-spree-sitemaps.git
mv vendor/extensions/dynamic-spree-sitemaps vendor/extensions/sitemaps
but it gives us
bash: script/extension: No such file or directory
please some one help me
I have not install this gem but script/extension install is old Rails 2.x command syntax. Instead do something like this.
In you Gemfile add:
gem 'dynamic-spree-sitemaps', :git => 'git://github.com/polomasta/dynamic-spree-sitemaps.git'
Or with https version:
gem 'dynamic-spree-sitemaps', :git => 'https://github.com/polomasta/dynamic-spree-sitemaps'
And run bundle install
Other way of installing directly from github source is by using a gem called specific_install
gem install specific_install
gem specific_install -l <url to a github gem>
In this case:
gem specific_install https://github.com/polomasta/dynamic-spree-sitemaps.git