Bundle install is throwing error when installing coffee-script-source -v '1.6.3' - coffeescript

I'm using Ruby 2.0.0 and Rails 4 but I'm getting an error with coffee-script when I generate new rails project
Installing coffee-script-source (1.6.3)
Errno::EACCES: Permission denied - /usr/local/rvm/gems/ruby-2.0.0-p247/build_info/coffee-script-source-1.6.3.info
An error occurred while installing coffee-script-source (1.6.3), and Bundler cannot continue.
Make sure that gem install coffee-script-source -v '1.6.3' succeeds before bundling.

I just ran into the same problem. Run
sudo bundle update
inside your new site directory. Ruby will then have no trouble installing whatever packages it needs to.

I has the same issue and came across your post when I googled it. I had to run:
sudo gem install turbolinks -v '1.3.0'
sudo gem install uglifier -v '2.2.1'
sudo gem install multi_json -v '1.8.2'
before I could get the bundle install to complete. However, if you are reading the rails tutorial (http://ruby.railstutorial.org/ruby-on-rails-tutorial-book#sec-rubygems), it says not to worry if that stage fails, as the railsgem file is updated and you manually run:
bundle update
bundle install
Hope this is of some help.

do once: sudo rails new demo
and then for other projects just rails new project_name

Related

Cannot install Cocoapods, keep getting error

I have been trying to install cocoapods but I keep getting an error. I have tried the following commands and get the same result.
sudo gem install cocoapods
sudo gem install -n /usr/local/bin cocoapods
Building native extensions. This could take a while...
ERROR: Error installing cocoapods:
ERROR: Failed to build gem native extension.
current directory: /Library/Ruby/Gems/2.6.0/gems/ffi-1.13.1/ext/ffi_c
/System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/bin/ruby -I /Library/Ruby/Site/2.6.0 -r ./siteconf20200726-37338-rvqxhv.rb extconf.rb
mkmf.rb can't find header files for ruby at /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/include/ruby.h
You might have to install separate package for the ruby development
environment, ruby-dev or ruby-devel for example.
extconf failed, exit code 1
Gem files will remain installed in /Library/Ruby/Gems/2.6.0/gems/ffi-1.13.1 for inspection.
Results logged to /Library/Ruby/Gems/2.6.0/extensions/universal-darwin-19/2.6.0/ffi-1.13.1/gem_make.out
After a lot of searching I finally came across a solution that I believe works. If you are use Mac OS Catalina you need to use Brew.
Open Terminal on your Mac.
Now, run
ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)" < /dev/null 2> /dev/null
Install cocoapods using brew
brew install cocoapods
cocoapods is ready to use now!

How to install cocoa pods in terminal?

I read cocoa pods documents and many times try to installed but always fail to installed because in starting steps i found one error so i can't install gems first. can anyone give me steps one by one? how to install or demo.
this is one link which i try.
http://www.raywenderlich.com/12139/introduction-to-cocoapods
OUTPUT in terminal
$ sudo gem install cocoapods
or i try
$ sudo gem install cocoapods -V
ERROR: While executing gem ... (TypeError)
nil can't be coerced into Fixnum
Thanks
Just try this before install cocoa pods
$ sudo gem update —system
then use this commond
$ sudo gem install cocoapods
Hope this will solved your issue.
Seems like an issue with your Ruby installation. You're running 1.8.7(mentioned in comment) which has been retired: https://www.ruby-lang.org/en/news/2013/06/30/we-retire-1-8-7/
Update Ruby(see https://www.ruby-lang.org/en/) and then run:
sudo gem update --system
sudo gem install cocoapods

Installing redmine_contacts plugin for bitnami_redmine

I am trying to install redmine_contacts plugin for my redmine 2.2.3.0 (which is installed using BITNami installer), as in readme.rdoc:
Copy redmine_contacts plugin to {RAILS_APP}/plugins on your redmine path
Run bundle install --without development test RAILS_ENV=production
Run rake redmine:plugins NAME=redmine_contacts RAILS_ENV=production
The first two steps was successful, but last executing last command, following error would occur:
(in /home/.../redmine-2.2.3-0/apps/redmine/htdocs)
Could not find sprockets-2.2.1 in any of the sources
Run bundle install to install missing gems.
To see if the sprockets library is installed by executing command: #bundle show sprockets, it shows a newer version of this library is installed:
/var/lib/gems/1.8/gems/sprockets-2.2.2
I think somehow the BitNami version of gem which is installed is not compatible with the sprockets-2.2.2 on the system and it requires 2.2.1. Maybe you should change to that version.
Try something like:
gem install sprockets -v 2.2.1

Bundle install ignores pg gem

When I type, "gem install pg", I get a message that the gem is installed along with the documenation.
But when I put "gem 'pg'" in the gemfile, and type "bundle install", it says that the bundle is complete. However if I type "bundle show pg", it says that it cannot find 'pg' in the current bundle. Accordingly, a command like "rake db:create:all", gives back, "no such file to load -- pg"
I am running on Ubuntu 11.04, Rails 3.0.11 and ruby 1.9.2.
Chris
I managed to fix this by deleting my Gemfile.lock and then running bundle install again. I am not sure why this works.
How I solved this problem:
I found the string in Gemfile.lock, in "GEM" section:
pg (0.15.1-x86-mingw32)
But I work on x64 OS (Windows 7 64), and "gem list" shows me "pg" gem as:
pg (0.15.1 x64-mingw32)
So, I replaced the string in Gemfile.lock to:
pg (0.15.1-x64-mingw32)
And my project works!
On Linux, I had to install these two devel libraries
sudo apt-get install postgresql
sudo apt-get install pgadmin3
bundle install
thats worked for me :)

Rails 3.1 - Pushing to Heroku - Errors installing postgres adapter?

I just upgraded to Rails 3.1 and the first app i've tried to deploy to Heroku has encountered a problem relating to Postgres adapter. I'm able to push the app to heroku but then when i try to migrate the database i get the following error:
heroku rake db:migrate
rake aborted!
Please install the postgresql adapter: `gem install activerecord-postgresql-adapter`
(pg is not part of the bundle. Add it to Gemfile.)
Tasks: TOP => db:migrate => db:load_config
(See full trace by running task with --trace)
when I try their suggested install i get:
ERROR: Could not find a valid gem 'activerecord-postgresql-adapter' (>= 0) in any repository
ERROR: Possible alternatives: activerecord-postgis-adapter, activerecord-jdbcpostgresql-adapter, activerecord-postgresql-cursors, activerecord-jdbcmysql-adapter, activerecord-jdbcmssql-adapter
which already seems weird... so what exact gem should I install to get this thing working if not what they say I should install??
When I try installing gem pg i get:
Building native extensions. This could take a while...
ERROR: Error installing pg:
ERROR: Failed to build gem native extension.
/Users/jerometufte/.rvm/rubies/ruby-1.9.2-p180/bin/ruby extconf.rb
checking for pg_config... no
No pg_config... trying anyway. If building fails, please try again with
--with-pg-config=/path/to/pg_config
checking for libpq-fe.h... no
Can't find the 'libpq-fe.h header
*** extconf.rb failed ***
Could not create Makefile due to some reason, probably lack of
necessary libraries and/or headers. Check the mkmf.log file for more
details. You may need configuration options.
Provided configuration options:
--with-opt-dir
...
I'm using SQLite3 currently. Any help greatly appreciated, this is baffling me.
Option 1:
Add pg to your Gemfile but skip trying to install it locally.
$ cat Gemfile
...
group :production do
# gems specifically for Heroku go here
gem "pg"
end
# Skip attempting to install the pg gem
$ bundle install --without production
Option 2 (Debian/Ubuntu):
Add pg to your Gemfile but first install the prerequisites.
$ cat Gemfile
...
group :production do
# gems specifically for Heroku go here
gem "pg"
end
# Install the pg gem's dependencies first
$ sudo apt-get install libpq-dev
# Then install the pg gem along with all the other gems
$ bundle install
You definitely need pg in the Gemfile for Heroku.
About the error you're getting locally: make sure you have postgres installed, run gem install pq -- --with-pg-config=[path to wherever your pg-config binary is], then bundle install.
Alternatively, if your local database is working fine (either because you're using sqlite or postgres-pr), you could put the gem 'pg' line in your Gemfile in a group called production, then bundle install --without production locally.
More up-to-date info: It had something to do with a different version of pg gem locally.
I already had pg in a production group (I run sqllite locally), but Heroku was still puking.
The problem went away for my new Rails 3.1 app when I:
rm Gemfile.lock
touch Gemfile
bundle install
git add .
git commit -am "wiped Gemfile.lock re-ran bundle install"
git push heroku master
worked like a charm when I then ran heroku run rake db:migrate